Bulk Uploading Mailboxes to Exchange Online and assigning licenses


Microsoft have made it really easy to perform bulk migrate migrations and assign licenses in Exchange Online.

You can export a csv and use it twice. The first csv will have the following headings

emailaddress
sean.ofarrell@contoso.com
ciaran.ofarrell@contoso.com
dean.jones@contoso.com
tecnicalfellow@contoso.com 

You can then upload the file then via the following option in Exchange Online 


And then to assign the licenses use the same csv but change the top heading to userprincipalname like below

userprincipalname
sean.ofarrell@contoso.com
ciaran.ofarrell@contoso.com
dean.jones@contoso.com
tecnicalfellow@contoso.com 

Connect to Office365 via the Windows Azure Active Directory Module for Windows PowerShell and do the following.


# First of all paste in the following variables

$AccountSkuId = “contoso:EXCHANGESTANDARD”
$UsageLocation = “IE”

# The paste the command in below with the correct CSV file path

$Users = Import-Csv “C:\Users\ergo\Desktop\Scripts\Import_users.csv”
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
}

And if you wanted to assign Exchange Online P2 Licenses then run the following commands,

# First of all paste in the following variables

$AccountSkuId = “contoso:EXCHANGEENTERPRISE”
$UsageLocation = “IE”

# The paste the command in below with the correct CSV file path

$Users = Import-Csv “C:\Users\ergo\Desktop\Scripts\Import_users.csv”
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
}

If you are using waad and want to assign a user with a P2 license an archive then you need to populate the AD attribute for the user “msExchRemoteRecipientType’ and change the value to 3. This can be done in bulk via ADMODIFY or Powershell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s