문제

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