Forum Discussion
Assign selective license in Office 365 using Powershell - "Unable to assign this license ..."
Got it working. This enables all licenses in the SKU while leaving previously assigned licenses untouched.
PS C:\Users\Ian> $MyLicenseOptions = New-MsolLicenseOptions -AccountSkuId "mytenant:STANDARDWOFFPACK_FACULTY" -DisabledPlans $null
PS C:\Users\Ian> PS C:\Users\Ian> Set-MsolUserLicense -UserPrincipalName "user@domain.com" -LicenseOptions $MyLicenseOptions
Perfect,
This script helped me a lot, in assigning pending plans to users already licensed.
Thank you
- DeletedOct 23, 2017
Hi,
let's assume I want to only change the ProvisioningStatus of one ServicePlan and a
user has the following ServicePlans set ((Get-MsolUser -UserPrincipalName $user).Licenses.ServiceStatus)):
ServicePlan ProvisioningStatus
----------- ------------------
YAMMER_ENTERPRISE Success
OFFICESUBSCRIPTION Disabled
SHAREPOINTENTERPRISE SuccessI want to set YAMMER_ENTERPRISE to "Disabled"
So I tried:
$licenseOptions = New-MsolLicenseOptions -AccountSkuId "companyname:ENTERPRISEPACK"
-DisabledPlans "YAMMER_ENTERPRISE"Set-MsolUserLicense -UserPrincipalName $user -LicenseOptions $licenseOptions
What this does is set YAMMER_ENTERPRISE to "disabled", as expected. However, OFFICESUBSCRIPTION will now be enabled. I know this is because any ServicePlan not specified for -DisabledPlans will be enabled.
Is there an option to have every ServicePlan remain unchanged but desired one (here YAMMER_ENTERPRISE)?
I'm asking because if I wanted to automate this for a whole tenant it'd be devastating if all ServicePlans not specified for -DisabledPlans got enabled beacuse many times different users have different combinations of ServicePlans enabled/disabled and the should remain unchanged.
Thanks for your help in advance.
- VasilMichevOct 23, 2017MVP
The cmdlets overwrite the service settings, they do not add/remove services. So when you setup the $licenseoptions variable, set both Yammer and Office to disabled. This script shows how you can do this in bulk for all users, respecting their enabled/disabled services.
- DeletedOct 24, 2017
Thanks. So do you agree that there's no convenient way to selectively enable/disable certain services so that we can treat users that have different combinations of services in bulk?
I imagine if one were to do some more elaborate scripting it might be possible. Unfortunately, this is out of my ability.