简体   繁体   中英

Powershell Office365 licensing steps clarification

I'm trying to understand why certain commands are failing when trying to provision unlicensed test users.

In particular,

$1 = "test-sp2@mycompany.org"
$a = Get-MsolUser -UserPrincipalName $1
$test = New-MsolLicenseOptions -AccountSkuId "mycompany:STANDARDWOFFPACK_FACULTY" -DisabledPlans @("PROJECTWORKMANAGEMENT","SWAY","INTUNE_O365","YAMMER_EDU","SHAREPOINTWAC_EDU","SHAREPOINTENTERPRISE_EDU")

Set-MsolUserLicense -UserPrincipalName $1 -LicenseOptions $test

Set-MsolUserLicense -UserPrincipalName $1 -AddLicenses "mycompany:STANDARDWOFFPACK_FACULTY" -LicenseOptions $test2

The latter 2 are failing with Set-MsolUserLicense : Unable to assign this license because the license options are invalid.

Does a user need a full license installed with "all" products installed to then be able to disabled ones you don't want them to have? Seems hokey to me? What am I missing?

This seems to work fine on licensed users only?

Thanks

I found that the test user didn't have a UsageLocation set. Once I set it to US, all the above commands were successful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM