繁体   English   中英

使用Powershell脚本设置Exchange 2010日历权限

[英]Setting Exchange 2010 Calendar permissions with powershell script

我找到了以下脚本,并对其进行了少许修改,以为用户(而非资源邮箱)设置默认的日历权限。 看起来它可以正常运行,但是您可以看看它是否有明显的问题吗?

$mailboxes = Get-Mailbox | where {$_.ResourceType -ne "Room"}

$mailboxes | foreach {
    $user=$_.Alias
    $path=$user+”:\Calendar”
    Set-MailboxFolderPermission –Identity $path -User Default -AccessRights Reviewer
}

在我看来还可以(未经测试)。 我将添加ResultSize参数以绕过1000个对象限制。 看起来您可以将其缩短一点。 在所有邮箱对象上运行之前,请对测试用户尝试此操作。

$mailboxes = Get-Mailbox -ResultSize Unlimited | Where-Object {$_.ResourceType -ne 'Room'}
$mailboxes | Foreach-Object { Set-MailboxFolderPermission –Identity ($_":\Calendar") -User Default -Accessrights Reviewer }
$mailboxes = Get-Mailbox -ResultSize Unlimited | Where-Object {$_.ResourceType -ne 'Room'}
$mailboxes | Foreach-Object { Set-MailboxFolderPermission –Identity ($_.Alias+":\Calendar") -User Default -Accessrights Reviewer }

$ mailboxes = Get-Mailbox -ResultSize无限| Where-Object {$ .ResourceType -ne'Room'} $ mailboxes | Foreach对象{Set-MailboxFolderPermission $ “:\\ Calendar”-用户默认-访问权限查看者}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM