首页 > 代码库 > 设置对Exchange Online 用户邮箱完全控制权限
设置对Exchange Online 用户邮箱完全控制权限
部分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
设置对Exchange Online 用户邮箱完全控制权限