Quickly add license option for all your users in Office 365

Just a simple PowerShell one liner for adding a new license pack for all your users in Office 365. Quite handy while in trial, and you just added for example the CRM Online pack.

First connect to Microsoft Online using PowerShell, and run Get-MsolAccountSku

That should return something like this

PS C:\Users\Anders> Get-MsolAccountSku

AccountSkuId          ActiveUnits     WarningUnits    ConsumedUnits
------------          -----------     ------------    -------------
aeb07:CRMSTANDARD     25              0               0
aeb07:ENTERPRISEPACK  25              0               24

Then simply run this command, and replace AccountSkuId, with the ID from the table above

Get-MsolUser | where {$_.isLicensed -eq $true} | Set-MsolUserLicense -AddLicenses "AccountSkuId"

This command simply gets all users in Office 365, and select only those who are licensed today, and then add the license. You can filter as you like in the where statement.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s