Creating Mailbox Accounts in Exchange 2016 Hybrid Model

Exchange Server Hybrid is really necessary for coexistence between on-premises and Exchange Online, smooth transition and migration to Exchange Online from on-premises, as well as managing Exchange Online resources from on-premises while AADConnect is enabled. Apart from that, Exchange Hybrid can be de-commissioned and Exchange Server itself in a very small footprint can be left on-premises in the scenario where AADConnect will be in-place.

If you have Moved your exchange environment from 2010 to 2013 or 2016, the new joiner account creation  is  different in  hybrid model. Powershell script becomes handy and automate the process.

To create user mailbox in Hybrid model,  Powershell script for creating multiple users mailbox.

Download the Excel file, Fill the user details, save and store in temp location. Run the below script.The new user account will created in your AD and on  exchange environment.

# Creating Mailbox on Hybrid Model Exchange environment

[Parameter( Mandatory=$false)]
$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$URL/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session

write-Host ‘connected to Exchange Server …….’ -NoNewline -ForegroundColor Green

$CSVLocation = “C:\temp\createUserMailbox.csv”

### Step 1 – User Creation
write-Host ‘Creating User Mailbox …….’ -NoNewline -ForegroundColor Green

Import-CSV $CSVLocation | ForEach-Object {
New-RemoteMailbox -Name $_.Name -FirstName $_.FirstName -Initials $_.Initials -Lastname $_.LastName -UserPrincipalName $_.UPN -OnPremisesOrganizationalUnit $_.OU -Password (ConvertTo-SecureString $_.password -AsPlainText -Force) -ResetPasswordOnNextLogon $false

write-Host ‘user account created …….’ -ForegroundColor Green

Download copy of Excel file




Post Comment

CommentLuv badge