使用powershell批量分配许可
2017-02-17 13:30
78 查看
以管理员身份运行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表示已经分配许可
查看订阅和使用状态
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表示已经分配许可
相关文章推荐
- 使用组件来保护你的ASP代码
- SCI软件使用方法总结-定位测量篇
- IP 伪装简易使用说明
- 源码推荐:一个使用C#绘制图形引擎的Framework
- Win32汇编教程六 工具栏和状态栏的使用
- Win32汇编教程五 菜单和加速键的使用
- Win32汇编教程三 一个简单的对话框 --- 兼谈资源文件的使用
- 使用ActiveX控件开发网页常见的问题
- 使用 ASP+ DataGrid 控件来创建主视图/详细资料视图 (2)
- 使用 ASP+ DataGrid 控件来创建主视图/详细资料视图
- 手册中关于怎样使用TQuery 的误导
- 使用ASP和Word进行服务器端拼写检查
- 单独使用CRecordSet
- 在 Web 页上使用条件数值格式
- 关于PHP与Sybase数据库的连接与使用
- 使用ASP常见问题解答
- [导入]Guru of the Week:#41 使用标准库
- 如何使用ASP进行打印操作
- VB中Winsock控制的UDP协议的使用
- FUNCky 的使用