0

Every couple of months we have to create 30+ accounts so I was wondering what's the best way to bulk-create the accounts and their mailboxes.

We have AD on 2003 and Exchange 2007.

Abdullah
  • 121
  • 1
  • 3
  • 6

1 Answers1

1

The easiest way is to get your new user information in a spread sheet with the following columns:

Firstname, Lastname,Aliasname,Database,OUPath

The OUPath is in the format of server\storagegroup\mailbox store

Then, use powershell to import the CSV file and create the users:

First thing you will need to do is create a password that will be used for each account (obviously you can see this so the user has to change it on logon).

$Password=Read-Host “Password” -AsSecureString

Then import the CSV file and loop through it

Import-CSV C:\CreateNewmailbox.csv |
foreach {
$userprincipalname = $_.Firstname + “.” +  $_.Lastname + “@domain.com”
new-mailbox -name $_.name -alias $_.alias -FirstName $_.Firstname -LastName $_.Lastname -userPrincipalName  $userprincipalname -database $_.Database -OrganizationalUnit  $_.OUpath -Password $Password
}
Sam Cogan
  • 38,158
  • 6
  • 77
  • 113
  • Thank you Sam. This looks good, but what other attributes can I add? And please explain some more about the creating the password and the Database attribute. – Abdullah Nov 22 '10 at 05:49