Managing calendar permissions in daily operations will be little bit difficult for an admin since there will be more requests coming in for the calendar permissions.
I have collected few scripts which will be useful in managing the calendar requests that are coming in the daily operations.
Use the below command to check the calendar permission for single user
Get-MailboxFolderPermission -Identity mailbox@domain.com:\Calendar | FL
To add the calendar permission for single user use the below command
Add-MailboxFolderPermission -Identity newtestuser1:\calendar -User Usermailbox -Accessrights editor
To check the calendar permission for a mailbox for a single user you can see the below command.
Get-MailboxFolderPermission -Identity mailbox@domain.com:\Calendar -User Test2
To change the default calendar permission for all the mailboxes in entire org you can use the below command.
$all=Get-Mailbox -RecipientTypeDetails UserMailbox
$all | ForEach {Set-MailboxFolderPermission -Identity “$($_.alias):\Calendar” -User default-AccessRights “LimitedDetails”
To change the mailbox access default permission for all the users for one mailbox you can use the below command
Get-Mailbox -resultsize unlimited | foreach {add-mailboxfolderpermission -identity “$($_.alias):\calendar” -User testuser -Accessrights “editor”}
To check the calendar permission for all the users run the below command
ForEach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) {Get-MailboxFolderPermission -Identity “$($Mailbox.Name):\Calendar” | Select @{n=’Calendar’;e={$Mailbox.Name}},User,AccessRights}
To take the calendar permissions for all the users in csv format do the following things
First run the below command to store the value of all the calendar permission by running the below command
$Results = ForEach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) {Get-MailboxFolderPermission -Identity “$($Mailbox.Name):\Calendar” | Select @{n=’Calendar’;e={$Mailbox.Name}},User,AccessRights}
Take the output in text file by running the below command
$Results | out-file -filepath C:\CalendarPermission.txt
Now run the below command to join the string and show the access rights for each user in the csv file
$Results = ForEach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) { Get-MailboxFolderPermission -Identity “$($Mailbox.Name):\Calendar” | Select @{n=’Mailbox’;e={$Mailbox.Name}},User,@{Name=’AccessRights’;Expression={[string]::join(“;”, ($_.AccessRights))}}
Now export the results
$Results | Export-Csv C:\permission8.csv
Hope this is helpful
Thanks
Sathish Veerapandian
MVP – Exchange Server
Leave a Reply