Forum Discussion
Robert Bollinger
Mar 20, 2019Iron Contributor
Exchange Online: Remove Calendar Permissions for a list of users from 1 mailbox
Hey Guys,
I am trying to remove calendar permissions for a list of users from a single mailbox. For Example this mailbox here: "Customer Mailbox" has 40 users added to various folders with reviewer, editor and other calendar permissions.
I would like to remove those users and make sure to leave the default permissions as is. here is my command that is not working.
Get-MailboxFolderPermission -Identity "Customer Mailbox" | Where {$_.User -notlike "*Default*" -and $_.User -notlike "*Anonymous*" -and $_.User -notlike "*Group Access*"} | foreach {Remove-MailboxFolderPermission -Identity "Customer Mailbox" -User $_}
The above command produces a result of about 40 users.
How might i get my command to work ?
Thanks,
Robert
- ChochiCopper Contributor
Will that also blow away any delegate permissions, where users can accept or decline on behalf of the calendar?
Get-MailboxFolderPermission -Identity "Customer Mailbox" | Where {$_.User -notlike "*Default*" -and $_.User -notlike "*Anonymous*" -and $_.User -notlike "*Group Access*"} | foreach {Remove-MailboxFolderPermission -Identity "Customer Mailbox" -User $_}
Simply run the cmdlet against the Calendar folder (so the Identity becomes "Customer mailbox:\Calendar").
If you want to remove the permissions for other folders as well, check this script: https://gallery.technet.microsoft.com/Office-365-Remove-mailbox-00cd2423