使用powershell批量分配许可

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用powershell批量分配许可相关的知识,希望对你有一定的参考价值。

以管理员身份运行AAD PS

技术分享

查看订阅和使用状态

Get-MsolAccountSku

技术分享

批量授予所有用户E3许可

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

技术分享

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

(Get-MsolUser -UserPrincipalName [email protected]ner.onm51CTO提醒您,请勿滥发广告!).licenses.servicestatus

技术分享

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

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

技术分享

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

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

技术分享

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

(Get-MsolUser -UserPrincipalName [email protected]提醒您,请勿滥发广告!).licenses.servicestatus

技术分享

技术分享

以上是关于使用powershell批量分配许可的主要内容,如果未能解决你的问题,请参考以下文章

使用Powershell管理Linux 下的 SQL Server

我正在使用来自 python 的 powershell 命令获取一些数据,而 Windows 中没有 cmd!如何将此输出分配给字符串变量?

sql Powershell Migration工具http://stackingcode.com/blog/2011/10/12/database-migrations-with-powershel

powershell 来自https://stackoverflow.com/questions/31051103/how-to-export-a-class-in-powershell-v5-mod

Office365混合部署实战系列教程五:迁移用户邮箱到Exchange Online

PowerShe 使用证书签名 ll脚本