Forum Discussion

blue_man's avatar
blue_man
Iron Contributor
Jun 07, 2020
Solved

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.

 

Connect-MsolService

$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 ###,
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId "tenant:ENTERPRISEPACK" -DisabledPlans "KAIZALA_O365_P3","MICROSOFT_SEARCH","WHITEBOARD_PLAN2","MIP_S_CLP1","MYANALYTICS_P2","BPOS_S_TODO_2","FORMS_PLAN_E3","Deskless","FLOW_O365_P2","POWERAPPS_O365_P2","PROJECTWORKMANAGEMENT","SWAY","INTUNE_O365","YAMMER_ENTERPRISE","RMS_S_ENTERPRISE","SHAREPOINTWAC"



$Users | ForEach-Object {

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

}

Resources