Author Posts

March 21, 2017 at 4:50 pm

While I'm waiting on MS I thought I'd ask if anyone else is experiencing the same issue.

$disablecol #is array
MCOVOICECONF_GOV
SHAREPOINTWAC_GOV
SHAREPOINTENTERPRISE_GOV

$options = New-MsolLicenseOptions -AccountSkuId $accountsku -DisabledPlans $disablecol

Error:

Set-MsolUserLicense -UserPrincipalName $upn -LicenseOptions $options -ErrorAction stop
Set-MsolUserLicense : Unable to assign this license because the license options are invalid.
At line:1 char:1
+ Set-MsolUserLicense -UserPrincipalName $upn -LicenseOptions $options ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Set-MsolUserLicense], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InvalidUserLicenseOptionException,Microsoft.O
nline.Administration.Automation.SetUserLicense

Strange output, broken machine

$options.disabledserviceplans
MCOVOICECONF_GOV SHAREPOINTWAC_GOV SHAREPOINTENTERPRISE_GOV

Object type is the same on working/broken machines.

$options.DisabledServicePlans.gettype()

IsPublic IsSerial Name BaseType
——– ——– —- ——–
True True List`1 System.Object

Output from working machine.

$options.DisabledServicePlans
MCOVOICECONF_GOV
SHAREPOINTWAC_GOV
SHAREPOINTENTERPRISE_GOV

Version:

(Get-Item C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll).VersionInfo.FileVersion
1.0.8000.119

March 21, 2017 at 5:11 pm

$options = New-MsolLicenseOptions -AccountSkuId $accountsku -DisabledPlans $($disablecol)

Fixed, no idea why this changed.