O365 Licensing Add Additional Service Plans via PowerShell


I am receiving the below error when running the below PowerShell command. I think this issue is because the user already has an E3 license with some service plans enabled. How do I enable additional service plans for a user who already has an E3 license and service plans enabled?


Set-MsolUserLicense : Unable to assign this license because it is invalid. Use the Get-MsolAccountSku cmdlet to retrieve a list of valid licenses.



$Users = Import-csv "C:\Users\username\Desktop\userlist.csv"
$AccountSkuId = "tenant:ENTERPRISEPACK"

$ServicePlans = Get-MsolAccountSku | Where {$_.SkuPartNumber -eq "ENTERPRISEPACK"}

### Setting up the license option to disable SharePoint etc ###,

$Users | ForEach-Object {

Set-msoluser -UserPrincipalName $_.UserPrincipalName
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId -LicenseOptions $LicenseOptions


2 Replies
best response confirmed by blue_man (Contributor)

actually would simply changing the foreach command to the below work?


$Users | ForEach-Object {

Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions