Photo by Polina Zimmerman on Pexels.com

Problem Description

There was a request to disable sharepoint online for few users but was receiving below error in doing so. Looked online but nothing exactly helped.

This is the reason, we are writing this article. Here is the common command, which helps to remove any license under a bundle license (Like M365 for Business, Office 365 E3, Office 365 E5 etc.)

Set-MsolUserLicense : Unable to assign this license.
At line:1 char:1
+ Set-MsolUserLicense -UserPrincipalName VerifySetting@learnsj.onmicros ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Set-MsolUserLicense], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InvalidLicenseConfigurationException,Microsoft.Online.Administration.Automation.SetUserLicense

Cause

Let’s check the status of Sharepoint License and it says PendingInput for SHAREPOINTSTANDARD. Or we can say, it is enabled.

Connect-MsolService

(Get-MsolUser -UserPrincipalName VerifySetting@learnsj.onmicrosoft.com).Licenses.ServiceStatus

Ran this command to disable “SHAREPOINTSTANDARD” but it thrown an error that “Unable to assign this license”. You may be thinking why, this error.

Preview(opens in a new tab)

Actually, Set-MsolUserLicense command only understand assignment of licenses, you control, what you need to disable by -LicenseOptions.

In this, SHAREPOINTSTANDARD (Sharepoint Online P2) has dependency on SHAREPOINTWAC (Office for web). So you would have to disable both to Disable SHAREPOINTSTANDARD (Sharepoint Online P2). This is the reason specifying SHAREPOINTSTANDARD and SHAREPOINTWAC in New-MsolLicenseOptions will work.

$AccountSkuId = "learnsj:SPB"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans "SHAREPOINTSTANDARD"
 
Set-MsolUserLicense -UserPrincipalName VerifySetting@learnsj.onmicrosoft.com -LicenseOptions $LicenseOptions
Set-MsolUserLicense : Unable to assign this license.
At line:1 char:1
+ Set-MsolUserLicense -UserPrincipalName VerifySetting@learnsj.onmicros ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Set-MsolUserLicense], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InvalidLicenseConfigurationException,Microsoft.Online.Administration.Automation.SetUserLicense

Fix

Running this command will disable Sharepoint Online because it includes Office for Web and Sharepoint Online both.

$AccountSkuId = "learnsj:SPB"

$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans "SHAREPOINTSTANDARD", "SHAREPOINTWAC"
Set-MsolUserLicense -UserPrincipalName VerifySetting@learnsj.onmicrosoft.com -LicenseOptions $LicenseOptions

(Get-MsolUser -UserPrincipalName VerifySetting@learnsj.onmicrosoft.com).Licenses.ServiceStatus

Now, SHAREPOINTSTANDARD and SHAREPOINTWAC shows disabled, Our problem is resolved.

Thank you for reading !

Script to Kill Okta User Session


Introduction You might have to kill Okta session of large number of users in a go, you can use this script to perform the same. Also, this script could be a starting point to invoke many API Methods for different purpose. You can save this as a .ps1 or go to my github url to […]

Unable to Activate Office 365 Pro Plus


Problem Description I have experience random issue in Activating Office 365 Pro Plus or Outlook just doesn’t work and it keeps on spinning on login prompt in Desktop Outlook. In these cases : We are sure that user credentials are correct. There is no issue with federation. No outage reported by Microsoft or your Identity […]

Azure AD Connect cloud Provisioning


Introduction Azure AD Connect cloud Provisioning could be helpful for the organizations with no hybrid or advanced configuration connectivity. and they just need to sync user to cloud for basic stuff. There is a table with the information on the different between Azure AD Connect and this one, please refer : https://docs.microsoft.com/en-us/azure/active-directory/cloud-provisioning/what-is-cloud-provisioning Steps mentioned below […]

Loading…

Something went wrong. Please refresh the page and/or try again.