Bulk create mailboxes from existing users in Exchange 2013

I have 6 OU's containing about 1050 users total. I need to assign them mailboxes on our Exchange 2013 server. I would like all these mailboxes to go into a particular database. Any idea of the commands I need to run to make this happen since ECP doesn't let us select multiple accounts like we could in 2010?
Casey WeaverManaged Services Windows Engineer IIIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael ChisholmCommented:

do an export of the users in AD to create a csv file the use this power shell script to create the mailboxes

 Import-CSV adusers.csv | ForEach {New-Mailbox -Alias $_.alias -Name $_.name -userPrincipalName $_.UPN -Database “Mailbox Database” -OrganizationalUnit Users -Password $Password}

here is a site that explains in steps

If the CSV is too complicated for you then this may help as well.


*********GUI Way***************

Navigate to you exchange management console
then go to recipient Configuration
then right click Mailbox and select new user
Choose the existing users you want to create (you can select in bulk from this screen)
on the next window you can  choose the database and other features
Amit KumarCommented:
Please try below one as you have users existing in OU just need to create mailboxes.

You can change searchbase OU according to your OU DN and if these are not nested OU then you will have to do it with one OU at once.

Import-module activedirectory

$users = Get-ADUser -LDAPfilter '(name=*)' -searchBase {OU=Employees,DC=contoso,DC=lab} 
foreach($user in $users)
   Enable-Mailbox -Identity $user.SamAccountName -Database <DBName>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Casey WeaverManaged Services Windows Engineer IIIAuthor Commented:
This solution was perfect, cut and paste and fill in the necessary info (like OU). Thanks alot!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.