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

时间:2013-02-11 08:12:25

标签: powershell permissions calendar exchange-server-2010

我找到了以下脚本并稍作修改,为用户设置了默认的日历权限,但没有设置资源邮箱的默认日历权限。看起来它会正常运行,但你能看一看,看看你是否看到任何明显的问题?

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

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

3 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

$ mailboxes = Get-Mailbox -ResultSize Unlimited | Where-Object {$ .ResourceType -ne'Room'} $ mailboxes | Foreach-Object {Set-MailboxFolderPermission $ “:\ Calendar”-User Default -Accessrights Reviewer}