Compartir a través de


Bulk creation of Exchange 2007 Mailboxes

So this week I had the need of some test's of integration with Exchange 2007, and the first show stopper was at the point of creating 1000 users for testing purposes. Ok the creation of the users in AD is easy just grab the old vbs scripts, now the Select All -> Enable Mailbox where is it??? ooops just forgot that this is Exchange 2007 users, well let's take a look at the Powershell notes:

And the result was this piece of cmdlet

 get-user | where-object{$_.RecipientType –eq "User"} | Enable-Mailbox –Database "SERVER NAME\MBX NAME"}

Get all users -----> then enable mailboxes for each one in this Server and Mailbox

 You can filter a little more by choosing the OU or other users attribute like department or Office

get-user –organizationalUnit CONTOSO OFFICE | where-object{$_.RecipientType –eq "User" -and $_.department –eq "Marketing"} | Enable-Mailbox –Database "SERVER NAME\MBX NAME"}