部分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

clip_p_w_picpath002

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