首页 > 系统服务 > 详细

使用powershell批量分配许可

时间:2017-02-17 22:10:02      阅读:253      评论:0      收藏:0      [点我收藏+]

以管理员身份运行AAD PS

技术分享

查看订阅和使用状态

Get-MsolAccountSku

技术分享

单个用户授予用户许可

技术分享

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

批量授予所有用户许可

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

技术分享

删除单个用户许可

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

技术分享

批量删除所有用户许可

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

技术分享

查看未授权许可的用户

Get-MsolUser -All -UnlicensedUsersOnly

技术分享

查看所有用户的许可分配状态

Get-MsolUser

技术分享

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

使用powershell批量分配许可

原文:http://gengchunhong.blog.51cto.com/9724014/1898839

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!