Office365批量分配许可(License)
来源:互联网 发布:国产女装品牌知乎 编辑:程序博客网 时间:2024/04/30 16:14
原文地址:http://blog.csdn.net/iuxin/article/details/26514579
- function Connect-MSService(){
- Import-Module MsOnline
- $cred=Get-Credential -Credential xxx@xxxx.com
- Connect-MsolService -Credential $cred #-errorAction silentlyContinue -errorvariable er
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell-LiveID -Credential $cred -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- }
- Connect-MSService
- $msolUsers = Get-MsolUser -All -Synchronized
- $mailboxUsers = Get-Mailbox -ResultSize unlimited|%{$_.UserPrincipalName}
- ## Define License Options
- ## There are five Services SHAREPOINTWAC,SHAREPOINTENTERPRISE,MCOSTANDARD,OFFICESUBSCRIPTION,EXCHANGE_S_ENTERPRISE in E3 Licence
- ## If you want to disable any of them in the licence options, just use -DisablePlans and follow the name of the services you want to disable
- $O365E3 = New-MsolLicenseOptions -AccountSkuId syndication-account:ENTERPRISEPACK_NO_RMS
- $O365E3_OnlyExchange = New-MsolLicenseOptions -AccountSkuId syndication-account:ENTERPRISEPACK_NO_RMS -DisabledPlans SHAREPOINTWAC,SHAREPOINTENTERPRISE,MCOSTANDARD,OFFICESUBSCRIPTION
- ## Process each user in the collection, if they have license already, change the license options, if not, add the License with options
- foreach ($msolUser in $msolUsers) {
- $HasLicense = $msolUser.IsLicensed
- if ($HasLicense) {
- #Write-Host $msolUser.UserPrincipalName -ForegroundColor Green
- #$msolUser | Set-MsolUserLicense -LicenseOptions $O365E3_OnlyExchange
- }
- else {
- if($mailboxUsers -contains $msolUser.UserPrincipalName){
- $msolUser | Set-MsolUser -UsageLocation "CN"
- $msolUser | Set-MsolUserLicense -AddLicenses "syndication-account:ENTERPRISEPACK_NO_RMS" -LicenseOptions $O365E3_OnlyExchange -ErrorAction Continue
- if($?){
- $msolUser.IsLicensed=$true
- }else{
- Write-Host $msolUser.UserPrincipalName -ForegroundColor green
- }
- }
- }
- }
阅读全文
0 0
- Office365批量分配许可(License)
- Office365批量分配许可(License)
- 开源软件的许可(License)
- 开源软件的许可(License)
- Oracle License 许可机制
- Office365客户端通过本地方式批量部署(即点即用部署)
- 许可协议介绍 GPL license
- 最新!ENVI 5.1 遥感图像处理软件(含license.dat许可亲测可用)
- arcgis license服务无法启动问题(arcgis 许可无法启动)
- 彻底看懂Oracle License许可机制
- 开源软件的许可协议 License
- 彻底看懂Oracle License许可机制
- 转:各种开源软件许可license
- 看懂Oracle License 许可机制【转】
- ModelSim-Altera 10.1b Software for Quartus II Software Version 12.1 (Linux) --许可文件安装(license)
- BEA全线产品的无限制授权许可License文件下载
- Avast! 4 Server 服务器版license许可文件获得方法
- 什么是Oracle技术网开发者许可 (OTN License)
- 守护进程原理分析以及linux下的daemon函数使用
- 面试题-螺旋队列
- Python 基础知识点 001
- 设计模式六大原则之三:依赖倒置原则
- Android开发之应用层到驱动层的接口实现(一)
- Office365批量分配许可(License)
- java代码实现打印菱形
- Pycharm连接Oracle数据库
- 在 Android Native 程序中输出 LOG
- sql:常用sql语句整理二 (连接查询)
- 使用Thrift的网络框架搭建一般性网络应用
- 阅读笔记_《effective-csharp》
- Python MySQLdb连接数据库的应用
- iOS 10 的适配问题