Mass/bulk create user account in Active Directory with Exchange mailboxes

active-directorybulk-actionexchange-2007user-accountswindows-server-2003

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.

Best Answer

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
}