部分1:
1.连接到Exchange Online
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell-LiveID/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
2. 对单个邮箱设置
例如:设置zhangsan对zhouwu的邮箱有完全访问的权限
Add-MailboxPermission -Identity "zhouwu" -User zhangsan -AccessRights fullaccess -InheritanceType all
3. 对所有邮箱设置
Get-Mailbox -ResultSize unlimited -Filter{(recipienttypedetails -eq ‘usermailbox‘)-and (alias -ne ‘zhangsan‘)} |Add-MailboxPermission -User zhangsan -AccessRights fullaccess -InheritanceType all
部分2:
去除邮箱权限
Remove-MailboxPermission这个命令为去除邮箱权限的命令,您只要把原来加权限的add-MailboxPermission变成Remove-MailboxPermission就可以去除权限;
具体参考链接:https://technet.microsoft.com/en-us/library/bb125153(v=exchg.160).aspx
原文地址:http://gengchunhong.blog.51cto.com/9724014/1889743