I have found the following script and modified it slightly to set the default Calendar permissions for the users but not the resource mailboxes. It looks like it will run correctly, but could you take a look and see if you see any glaring issues with it?

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

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

解决方案

Looks OK to me (not tested). I would add the ResultSize parameter to bypass the 1000 objects limitation. Looks like you can shorten it a bit. Try this on a test user before you run on all mailbox objects.

$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 Unlimited | Where-Object {$.ResourceType -ne 'Room'} $mailboxes | Foreach-Object { Set-MailboxFolderPermission $":\Calendar" -User Default -Accessrights Reviewer }

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top