使用powershell批量分配许可

以管理员身份运行AAD PSide

image

查看订阅和使用状态3d

Get-MsolAccountSkublog

clip_image001

单个用户授予用户许可ip

clip_image003

Set-MsolUserLicense -UserPrincipalName "belindan@litwareinc.com" -AddLicenses "litwareinc:ENTERPRISEPACK"ci

批量授予全部用户许可get

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

clip_image005

删除单个用户许可it

Set-MsolUserLicense -UserPrincipalName belindan@litwareinc.com -RemoveLicenses "litwareinc:ENTERPRISEPACK"io

clip_image007

批量删除全部用户许可class

$x = Get-MsolUser -All | where {$_.isLicensed -eq $true}; $x | foreach {Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses "qwew:ENTERPRISEPACK_NO_RMS"}

clip_image009

查看未受权许可的用户

Get-MsolUser -All -UnlicensedUsersOnly

image

查看全部用户的许可分配状态

Get-MsolUser

image

isLicensed 属性值为False表示未分配许可,True表示已经分配许可

相关文章
相关标签/搜索