Page 1 of 1

Bulk enable the AD mail user using PowerShell ?

Posted: Fri Jul 20, 2018 12:12 am
by ITEngineer
Hi All,

I need some assistance in the bulk PowerShell script to enable some of the users that have been provisioned in the Office 365 Exchange Online, but does not have the OnPremise Exchange mailbox:

This is the one-liners that I must execute manually one by one for every new user provisioned in the Office365:

Source OU:
OU=Global Users,DC=CompanyA,DC=com (225 users in total)

Code: Select all

Enable-Mailuser -Identity samAccountName -primarySMTPAddress First.Last@CompanyA.com -ExternalEmailAddress First.Last@GlobalCompanyLtd.onmicrosoft.com 
OU=Global Users,DC=CompanyB,DC=com (182 users in total)

Code: Select all

Enable-Mailuser -Identity samAccountName -primarySMTPAddress First.Last@CompanyB.com -ExternalEmailAddress First.Last@GlobalCompanyLtd.onmicrosoft.com 
The samAccountName is in the format of First.LastName.

Thanks in advance for assisting me in enabling the bulk users with the script.

Re: Bulk enable the AD mail user using PowerShell ?

Posted: Fri Jul 20, 2018 12:20 am
by jvierra
Just execute the command in a loop once for each user.