SOLVED

O365 Licensing Add Additional Service Plans via PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1447110%22%20slang%3D%22en-US%22%3EO365%20Licensing%20Add%20Additional%20Service%20Plans%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1447110%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20receiving%20the%20below%20error%20when%20running%20the%20below%20PowerShell%20command.%20I%20think%20this%20issue%20is%20because%20the%20user%20already%20has%20an%20E3%20license%20with%20some%20service%20plans%20enabled.%20How%20do%20I%20enable%20additional%20service%20plans%20for%20a%20user%20who%20already%20as%20an%20E3%20license%20and%20service%20plans%20enabled%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ESet-MsolUserLicense%20%3A%20Unable%20to%20assign%20this%20license%20because%20it%20is%20invalid.%20Use%20the%20Get-MsolAccountSku%20cmdlet%20to%20retrieve%20a%20list%20of%20valid%20licenses.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-MsolService%3C%2FP%3E%3CP%3E%24Users%20%3D%20Import-csv%20%22C%3A%5CUsers%5Cusername%5CDesktop%5Cuserlist.csv%22%3CBR%20%2F%3E%24AccountSkuId%20%3D%20%22tenant%3AENTERPRISEPACK%22%3C%2FP%3E%3CP%3E%24ServicePlans%20%3D%20Get-MsolAccountSku%20%7C%20Where%20%7B%24_.SkuPartNumber%20-eq%20%22ENTERPRISEPACK%22%7D%3C%2FP%3E%3CP%3E%23%23%23%20Setting%20up%20the%20license%20option%20to%20disable%20SharePoint%20etc%20%23%23%23%2C%3CBR%20%2F%3E%24LicenseOptions%20%3D%20New-MsolLicenseOptions%20-AccountSkuId%20%22tenant%3AENTERPRISEPACK%22%20-DisabledPlans%20%22KAIZALA_O365_P3%22%2C%22MICROSOFT_SEARCH%22%2C%22WHITEBOARD_PLAN2%22%2C%22MIP_S_CLP1%22%2C%22MYANALYTICS_P2%22%2C%22BPOS_S_TODO_2%22%2C%22FORMS_PLAN_E3%22%2C%22Deskless%22%2C%22FLOW_O365_P2%22%2C%22POWERAPPS_O365_P2%22%2C%22PROJECTWORKMANAGEMENT%22%2C%22SWAY%22%2C%22INTUNE_O365%22%2C%22YAMMER_ENTERPRISE%22%2C%22RMS_S_ENTERPRISE%22%2C%22SHAREPOINTWAC%22%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%24Users%20%7C%20ForEach-Object%20%7B%3C%2FP%3E%3CP%3ESet-msoluser%20-UserPrincipalName%20%24_.UserPrincipalName%3CBR%20%2F%3ESet-MsolUserLicense%20-UserPrincipalName%20%24_.UserPrincipalName%20-AddLicenses%20%24AccountSkuId%20-LicenseOptions%20%24LicenseOptions%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1447110%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELicensing%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1447127%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20Licensing%20Add%20Additional%20Service%20Plans%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1447127%22%20slang%3D%22en-US%22%3E%3CP%3Eactually%20would%20simply%20changing%20the%20foreach%20command%20to%20the%20below%20work%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fenterprise%2Fpowershell%2Fdisable-access-to-services-with-office-365-powershell%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fenterprise%2Fpowershell%2Fdisable-access-to-services-with-office-365-powershell%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24Users%20%7C%20ForEach-Object%20%7B%3C%2FP%3E%3CP%3ESet-MsolUserLicense%20-UserPrincipalName%20%24_.UserPrincipalName%20-LicenseOptions%20%24LicenseOptions%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1448625%22%20slang%3D%22en-US%22%3ERe%3A%20O365%20Licensing%20Add%20Additional%20Service%20Plans%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1448625%22%20slang%3D%22en-US%22%3EThis%20worked%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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

}

2 Replies
Highlighted
Solution

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

 

https://docs.microsoft.com/en-us/office365/enterprise/powershell/disable-access-to-services-with-off...

 

$Users | ForEach-Object {

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

}

Highlighted