Logo
Lose Weight
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Server

Administering an Exchange Server 2013 Environment (part 5) - Performing Common Tasks - Creating Multiple Mailboxes in the Exchange Management Shell

2/18/2014 3:11:10 AM
Creating Multiple Mailboxes in the Exchange Management Shell

Given the complexity of creating a new mailbox in the EMS, why would anyone want to do so? Generally, they wouldn’t. But what if your Human Resources Department handed you a list of 50 new employees and requested that you create new mailboxes for all of them? Doing so through the GUI interface of the EAC would not only take hours, but would also result in the increased likelihood that misspellings or mistakes might occur.

That’s where the power of the EMS comes into play.

By putting the list of names in a .csv file, you can quickly create multiple accounts from only two lines of code. To do so, perform the following steps:

1. Create a text file called newusers.csv in a directory called (for our example) c:\scripts.

2. For this example, create several column names and populate the data, as shown in Figure 4. The columns to populate are Name, Alias, UPN, First, and Last. Additional column names can be added, if desired, to populate more data in the user accounts.

Image

Figure 4. Creating the CSV file for multiple mailbox creation.

3. When the .csv file is complete, you are ready to begin. Each user account will be created with a default password, with the user required to reset the password when he or she first logs in. From the Exchange Management Shell, type the following command. (Type it word for word, do not attempt to enter the password yet.)

$Password = Read-Host "Enter Password" -AsSecureString

Press Enter. You will be presented with a prompt stating Enter Password. Type the password you want to apply to all your newly created users and press Enter. Your password will now be assigned to the variable $Password for use in your script.

4. Next, you run two cmdlets, piping the results of the first into the second, to create the new mailboxes from the .csv file. The syntax will be as follows:

Import-Csv "c:\scripts\newusers.csv" | foreach { New-Mailbox –name $_.Name
–alias $_.Alias –UserPrincipalName $_.UPN -FirstName $_.First -LastName
$_.Last -Password $Password
–ResetPasswordOnNextLogon:$true}

The result, as shown in Figure 5, is the creation of the new mailboxes. The existence can be confirmed by viewing the mailboxes in the Exchange Management Console. (Remember to refresh the screen if you already had it open.)

Image

Figure 5. End result of multiple mailbox creation script.

Again—while this is a significant amount of work for three users, the same concept can be used to create 50 users (or 500) and can prove to be a valuable time-saver.

Other -----------------
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 3) - Using the Print Management Console
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 2) - Adding New Printers as Network Shared Resources
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 1) - Configuring the Print Management Console
- Windows Server 2008 : Configuring Server Core after Installation (part 4) - Setting the Time, Date, and Time Zone , Joining a Domain
- Windows Server 2008 : Configuring Server Core after Installation (part 3) - Logging Off, Shutting Down, and Rebooting
- Windows Server 2008 : Configuring Server Core after Installation (part 2) - Restoring the Command Prompt , Renaming the Computer
- Windows Server 2008 : Configuring Server Core after Installation (part 1) - Installing Server Core
- Microsoft Exchange Server 2010 : Introducing Journaling - Implementing Journaling, Reading Journal Reports
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 5) - Creating New Rules with the Exchange Management Shell
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 4) - Creating New Rules with the Exchange Management Console
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 3) - Selecting Actions
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 2) - Selecting Conditions and Exceptions
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 1) - Transport Rules Coexistence Between Exchange 2007 and 2010 , Transport Rules and Server Design Decisions
- Microsoft Systems Management Server 2003 : Analysis and Troubleshooting Tools - Using SMS Trace (part 2)
- Microsoft Systems Management Server 2003 : Analysis and Troubleshooting Tools - Using SMS Trace (part 1) - Obtaining SMS Trace
- Microsoft Systems Management Server 2003 : Analysis and Troubleshooting Tools - Using SMS Service Manager
- Microsoft Systems Management Server 2003 : Analysis and Troubleshooting Tools - Status Message Process Flow
- Microsoft Systems Management Server 2003 : Analysis and Troubleshooting Tools - Working with Status Message Queries
- Microsoft Systems Management Server 2003 : Filtering Status Messages (part 2) - Status Filter Rules
- Microsoft Systems Management Server 2003 : Filtering Status Messages (part 1) - Configuring Status Reporting Properties
 
 
Most view of day
- Windows Server 2008 R2 file and print services : Administering Distributed File System Services (part 1) - Configuring and administering DFS Namespaces
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 3)
- Managing Client Protection : User Account Control (part 2) - UAC User Interface, How Windows Vista Determines Whether an Application Needs Administrative Privileges
- Understanding Network Services and Active Directory Domain Controller Placement for Exchange Server 2013 (part 9)
- Microsoft Exchange Server 2007 : Consolidating a Windows 2000 Domain to a Windows Server 2003 Domain Using ADMT (part 5) - Migrating Computer Accounts
- Adobe Dreamweaver CS5 : Working with Multimedia and Online Tools - Checking for Plug-ins
- Microsoft Sharepoint 2013 : User Authentication (part 4) - Using Claims-Based Identity - Federated User Authentication Process
- BizTalk Server 2009 Operations : Disaster Recovery (part 1) - Configuring the Destination System for Log Shipping
- Developing Disk Images : Creating Image Builds
- Sharepoint 2013 : The Office Web Applications for Sharepoint - Preparing the Server and Installing OWA via the GUI
Top 10
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
- MDT's Client Wizard : Application Properties
- MDT's Client Wizard : Operating System Properties
- MDT's Client Wizard : Customizing the Deployment Share
- Windows Server 2012 : Software and User Account Control Administration (part 5) - Maintaining application integrity - Configuring run levels
- Windows Server 2012 : Software and User Account Control Administration (part 4) - Maintaining application integrity - Application access tokens
- Windows Server 2012 : Software and User Account Control Administration (part 3) - Mastering User Account Control - Configuring UAC and Admin Approval Mode
- Windows Server 2012 : Software and User Account Control Administration (part 2) - Mastering User Account Control - Elevation, prompts, and the secure desktop
- Windows Server 2012 : Software and User Account Control Administration (part 1) - Software installation essentials
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro