Office 365: Fine-Grained License Activation

Using PowerShell to manage Office 365 could be a little bit tricky. Please find below my experience trying to enable few services plans to an existing SKU (E1,E3,E5).

You need to know that the only way to enable a particular Office 365 plans is to run a PowerShell command New-MsolLicenseOptions with the option -DisabledPlans. So you need to know what you want to disable first and it then deduces what will be activated.

First, a list of the Office 365 Plans for E3 (on 21/02/17)

“Deskless” StaffHub
“FLOW_O365_P2” Flow
“POWERAPPS_O365_P2” PowerApps
“TEAMS1” Teams
“PROJECTWORKMANAGEMENT” Planner
“SWAY” Sway
“INTUNE_O365” InTunes
“YAMMER_ENTERPRISE” Yammer
“RMS_S_ENTERPRISE” Azure RMS
“OFFICESUBSCRIPTION” Office ProPlus
“MCOSTANRDARD” Skype For Business
“SHAREPOINTWAC” Office Online
“SHAREPOINTENTERPRISE” Sharepoint & OneDrive
“EXCHANGE_S_ENTERPRISE” Exchange Online

NB: "SHAREPOINTWAC" and "SHAREPOINTENTERPRISE" are linked, and can’t be enabled or disabled individually. (perhaps you can do it using web administrator center)

To find what is this current ProvisioningStatus of a particular user

(Get-MsolUser -UserPrincipalName user@contoso.com).Licenses.ServiceStatus

I’m using a very simple script to batch modify all my users who are license enabled and where ServiceStatus[9] status is disabled (corresponding of Skype for Business in my case). To find the corresponding ServiceStatus[9] you just need to count and find the right service number. Try with only one test user first.

$Options = New-MsolLicenseOptions -AccountSkuId "tenant_name:ENTERPRISEPACK" -DisabledPlans "FLOW_O365_P2","POWERAPPS_O365_P2","TEAMS1","PROJECTWORKMANAGEMENT","SWAY","YAMMER_ENTERPRISE","EXCHANGE_S_ENTERPRISE","SHAREPOINTWAC","SHAREPOINTENTERPRISE"
$users = Get-MsolUser -All -DomainName "contoso.com" -Synchronized | where {$_.isLicensed -eq $true -and $_.Licenses[0].ServiceStatus[9].ProvisioningStatus -eq "Disabled"}

Foreach ($user in $users){
Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -LicenseOptions $Options
$Output = $user.UserPrincipalName
$Output | out-file -append C:\LicensedUsers.txt -Encoding UTF8
}

After running this little powershell, all users without Skype4B and licences enabled users are getting the following new licences : StaffHub, InTunes, Azure RMS, Office ProPlus, Skype4B.

Leave a Comment