Modifying O365 service plan with PowerShell
Solution 1:
Well, I'm an idiot. I went through the GUI and tried to add Office Online and it complained that it requires Sharepoint as well.
So when I updated the code to
$ServicePlans = ((Get-MsolAccountSku | Where-Object {$_.AccountSkuId -eq $LicSKU}).ServiceStatus | Select-Object ServicePlan -ExpandProperty ServicePlan).ServiceName
$EnabledPlans = 'EXCHANGE_S_STANDARD','YAMMER_ENTERPRISE', 'MCOSTANDARD', 'SHAREPOINTSTANDARD', 'SHAREPOINTWAC'
$DisabledPlans = @()
foreach($Plan in $ServicePlans) {
if($EnabledPlans -notcontains $Plan) {
$DisabledPlans += $Plan
}
}
I was able to modify the license without issues.
Solution 2:
You could also try using Azure Portal for license management (Azure Active Directory - Licenses). It supports assigning licenses to user groups. So you would only need to do assignment once for some group which includes all users. And you would never need to do any assignment when new users are included.