Monday, 9 May 2011

Exchange 2010 Calendar Permissions from the Powershell

With Exchange 2010 came the ability to manage permissions on folders through the powershell, one of the most common tasks with this is managing calendar permissions. Here are a set of simple commands to aid managing them.

To get the permissions of a mailbox:
Get-MailboxPermission -identity "Dan Woodhouse"
To get the permissions of a subfolder in a mailbox:
Get-MailboxFolderPermission -identity "Dan Woodhouse:\Calendar"
To change permissions on a subfolder in a mailbox:
Add-MailboxFolderPermission -identity "Dan Woodhouse:\Calendar" -user "The Boss" -AccessRights Reviewer
To remove permissions on a subfolder in a mailbox:
Remove-MailboxFolderPermission -identity "Dan Woodhouse:\Calendar" -user "The Boss"
If we wanted to add permissions to every mailbox that matches a certain criteria we can use filters, in the example below we will grant The Boss Author permissions to every mailbox for users whos name starts with Dan and are based in the Birmingham office:
Get-mailbox -Filter {(Name -like 'Dan*' -and Office -eq 'Birmingham')} | ForEach-Object {Add-MailboxFolderPermission $_":\Calendar" -User "The Boss" -AccessRights Author}
To remove these permissions we could use:
Get-mailbox -Filter {(Name -like 'Dan*' -and Office -eq 'Birmingham')} | ForEach-Object {Remove-MailboxFolderPermission $_":\Calendar" -User "The Boss"}

15 comments:

  1. Thnx, i needed that command !

    ReplyDelete
  2. Thanks, very helpful and understandable.

    ReplyDelete
  3. Saved my bacon, thanks!

    ReplyDelete
  4. I'm Error with message "user:\Calendar Could not be found"
    seem like not have function :\Calendar in my cmdlet.
    anyone help me ?

    ReplyDelete
    Replies
    1. be sure you are using Get-MailboxFolderPermission

      Delete
    2. I was having this problem too until you pointed out the difference in cmdlet being used. Thanks.

      Delete
  5. It worked. Thanks for the article. It is useful.

    ReplyDelete
  6. dows this also remove the users permission to view the calendar? or does it just remove it from their view?

    ReplyDelete
    Replies
    1. It removes their custom permission set, if the default is to view they will revert to that.

      Delete
  7. Hi Dan, I have this page bookmarked as it's helped me a few times and is always a good reference.
    It might be worth adding the following for if a user already has permissions that need to be changed:

    Set-MailboxFolderPermission -identity "Dan Woodhouse:\Calendar" -user "The Boss" -AccessRights Reviewer

    ReplyDelete

Correction, question or suggestion, it's all welcome here.