Recipients Creation Script For Exchange 2010 or 2007


I have been building labs constantly and found that I needed a way to quickly populate my exchange environments with users. here is the powershell scripts I use

1. Save the following as Provisionusers.ps1

$Password=Read-Host “Enter Password” -AsSecureString
Import-CSV CreateRecipients.csv | foreach {new-mailbox -alias $_.name -name $_.Name -userPrincipalName $_.userPrincipalName -database $_.Database -org $_.OrganizationalUnit -lastname $_.Lastname -firstname $_.Firstname -Password $Password}

2. Save this as CreateRecipients.csv

Database,UserPrincipalName,OrganizationalUnit,Name,LastName,FirstName
Mailbox Database 1936175296,user@domain.com,Domain.local/Lab Users/OU1,User1,Last1,First1
2k3server\First Storage Group\Mailbox Store (2k3server),user@domain.com,Domain.local/Lab Users/OU2,User2,Last2,First2
2k7Server\First Storage Group\Mailbox Database,user@domain.com,Domain.local/Lab Users/OU3,User3,Last3,First3

3. Edit the csv file with the users you want to load

4. Open Exchange Powershell and CD to the directory where the files are saved, and then type ./Provisionusers.ps1, it will prompt you for a password, this is the default password that will be used.

Note: You may have to change the Powershell Security policy
Set-ExecutionPolicy Unrestricted or Set-ExecutionPolicy RemoteSigned

Mail Box Creation parameters http://technet.microsoft.com/en-us/library/aa997663.aspx
Thanks for the info Bharat to get me going

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s