Exclude database from auto-provisioning
When mailboxes are created in Exchange Server (2010 and above), you have the option of selecting an existing database to host the new mailbox. However, if you create the mailbox without specifying a database, the mailbox will be created in the default mailbox database.
For example, if you have two databases;Run the following command to check which of your current databases have been excluded from auto-provisioning.
Get-MailboxDatabase | select Identity,IsExcludedFromProvisioning
Set-MailboxDatabase "Mailbox-Database-users" -IsExcludedFromProvisioning $True
Ensure the file is saved with a CSV extension (.csv). I used mailboxcreation as the file name.
I.e. mailboxcreation.csv as shown in the next screenshot.
Step2. Create the mailboxes in bulk using the CSV file created
$Password=Read-Host “Please enter password” –AsSecureString
Run the following command to create mailboxes in bulk using the value saved in variable $Password.
This will create users in the "Users" OU in Active Directory. You may change the OU based on your AD structure.
Import-CSV "c:\mailboxeslis.csv" | ForEach {New-Mailbox -Name $_.name -firstname $_.firstname -lastname $_.lastname -userPrincipalName $_.userprincipalname -OrganizationalUnit Users -Password $Password}
Get-Mailbox Testingcreation | fl Name,database
To clear certificate error and set URLs in Exchange2010.
To clear certificate error and set URLs in Exchange2013.
To clear certificate error and set URLs in Exchange2016/2019.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)