以管理员身份运行AAD PS

image

查看订阅和使用状态

Get-MsolAccountSku

clip_image001

批量授予所有用户E3许可

Get-MsolUser -All -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "qwew:ENTERPRISEPACK_NO_RMS"

clip_image005

查看某个用户已经分配的许可

(Get-MsolUser -UserPrincipalName lili@qwew.partner.onm51CTO提醒您,请勿滥发广告!).licenses.servicestatus

image

定义新的许可变量,除了Exchange 产品,其他的产品都禁用

$LicenseOptions1 = New-MsolLicenseOptions -AccountSkuId qwew:ENTERPRISEPACK_NO_RMS -DisabledPlans SHAREPOINTWAC,SHAREPOINTENTERPRISE,OFFICESUBSCRIPTION,MCOSTANDARD

image

执行命令,使定义新的许可变量生效(标记部分换成自己的AccountSkuId)

Get-MsolUser -all | where {($_.islicensed -eq $true) -and ($_.licenses.accountskuid -eq 'qwew:ENTERPRISEPACK_NO_RMS')} | Set-MsolUserLicense -LicenseOptions $licenseoptions1

image

查看设置是否生效,使用命令行或者图形界面

(Get-MsolUser -UserPrincipalName lili@qwew.partner.onm51CTO提醒您,请勿滥发广告!).licenses.servicestatus

image

image