Windows 7 / Getting Started

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 EMC 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, we 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 our example, we create several column names and populate the data. The columns we will populate are Name, Alias, UPN, First, Middle, and Last. Additional column names can be added, if desired, to populate more data in the user accounts.
  3. When the .csv file is complete, we are ready to begin. Each user account will be created with a default password, with the user required to reset the password when they first log 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
    And 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 our script.
  4. Next, we 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 -Initials $_.Middle -LastName $_.Last -Password $Password -ResetPasswordOnNextLogon:$true}

The result is the creation of the new mailboxes shown. 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.)

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.

Creating a New Mailbox in the Exchange Control Panel

Before administrators can create a new mailbox in the Exchange Control Panel, they must be granted the rights to do so using RBAC.

Once they have the appropriate permissions, creating a new mailbox in the Exchange Control Panel is so easy that it's hardly worth the time to explain it. However, because the ECP is brand new, this section runs through the process to show how quick and easy it is.

To create a new mailbox user in the Exchange Control Panel, perform the following steps:

  1. Log in to the OWA server with administrative credentials.
  2. From the OWA page, select Options.
  3. Select Manage Your Organization.
  4. Ensure My Organization is selected in the UI Scope Control, Users & Groups is selected in the Primary Navigation Panel, and Mailboxes is selected in the Secondary Navigation Panel.
  5. Click the New Mailboxes icon.
  6. On the New Mailbox page, enter the information for the new account. Those marked with asterisks (*) are required fields. An example of the New Mailbox page.
  7. When finished, click the Save button.

The ECP passes the information on to the CAS server, which, in turn, uses Remote PowerShell commands to perform the actual operation and create the account.

[Previous] [Contents] [Next]