部分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 -Acce***ights fullaccess -InheritanceType all
3. 對所有郵箱設置
Get-Mailbox -ResultSize unlimited -Filter{(recipienttypedetails -eq 'usermailbox')-and (alias -ne 'zhangsan')} |Add-MailboxPermission -User zhangsan -Acce***ights fullaccess -InheritanceType all
部分2:
去除郵箱權限
Remove-MailboxPermission這個命令爲去除郵箱權限的命令,您只要把原來加權限的add-MailboxPermission變成Remove-MailboxPermission就可以去除權限;
具體參考鏈接:https://technet.microsoft.com/en-us/library/bb125153(v=exchg.160).aspx