Add Calendar permissions to mailboxes in Hybrid environments.

Hi again,

Below script will add Reviewer permissons for DefaultCalendarShare group. This is needed for Hybrid environments and Cross-Premises calendar sharing.

$allmailbox =
Get-Mailbox -Resultsize
Unlimited |
where { $_.IsShared -eq
$False -and
$_.ArbitrationMailbox
-eq $Null
}

$Logfile =
“C:TempLogsadd-calendarPerm.log”

Foreach ($Mailbox
in $allmailbox)

{

$cal
= (Get-MailboxFolderStatistics
$Mailbox |
where {$_.foldertype -eq
“calendar” } )

$Kalenteri= $cal.name

Add-mailboxfolderpermission
-identity $Mailbox.UserPrincipalname+”:$Kalenteri”
-user DefaultCalendarShare
-Accessrights Reviewer

Add-Content
$Logfile “Add
permission to $Mailbox folder $Kalenteri”

Write-host
“Add permission to $Mailbox folder $Kalenteri”

}
Author: Harri Jaakkonen

Leave a Reply

Your email address will not be published. Required fields are marked *