Exchange Online: Remove Calendar Permissions for a list of users from 1 mailbox

%3CLINGO-SUB%20id%3D%22lingo-sub-377740%22%20slang%3D%22en-US%22%3EExchange%20Online%3A%20Remove%20Calendar%20Permissions%20for%20a%20list%20of%20users%20from%201%20mailbox%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-377740%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Guys%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20remove%20calendar%20permissions%20for%20a%20list%20of%20users%20from%20a%20single%20mailbox.%20For%20Example%20this%20mailbox%20here%3A%20%22Customer%20Mailbox%22%20has%2040%20users%20added%20to%20various%20folders%20with%20reviewer%2C%20editor%20and%20other%20calendar%20permissions.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20remove%20those%20users%20and%20make%20sure%20to%20leave%20the%20default%20permissions%20as%20is.%20here%20is%20my%20command%20that%20is%20not%20working.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-MailboxFolderPermission%20-Identity%20%22Customer%20Mailbox%22%20%7C%20Where%20%7B%24_.User%20-notlike%20%22*Default*%22%20-and%20%24_.User%20-notlike%20%22*Anonymous*%22%20-and%20%24_.User%20-notlike%20%22*Group%20Access*%22%7D%20%7C%20foreach%20%7BRemove-MailboxFolderPermission%20-Identity%20%22Customer%20Mailbox%22%20-User%20%24_%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20above%20command%20produces%20a%20result%20of%20about%2040%20users.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20might%20i%20get%20my%20command%20to%20work%20%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERobert%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-377740%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-378067%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%20Online%3A%20Remove%20Calendar%20Permissions%20for%20a%20list%20of%20users%20from%201%20mailbox%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-378067%22%20slang%3D%22en-US%22%3E%3CP%3ESimply%20run%20the%20cmdlet%20against%20the%20Calendar%20folder%20(so%20the%20Identity%20becomes%20%22Customer%20mailbox%3A%5CCalendar%22).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20remove%20the%20permissions%20for%20other%20folders%20as%20well%2C%20check%20this%20script%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Remove-mailbox-00cd2423%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Remove-mailbox-00cd2423%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-678419%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%20Online%3A%20Remove%20Calendar%20Permissions%20for%20a%20list%20of%20users%20from%201%20mailbox%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-678419%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78373%22%20target%3D%22_blank%22%3E%40Robert%20Bollinger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWill%20that%20also%20blow%20away%20any%20delegate%20permissions%2C%20where%20users%20can%20accept%20or%20decline%20on%20behalf%20of%20the%20calendar%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-MailboxFolderPermission%20-Identity%20%22Customer%20Mailbox%22%20%7C%20Where%20%7B%24_.User%20-notlike%20%22*Default*%22%20-and%20%24_.User%20-notlike%20%22*Anonymous*%22%20-and%20%24_.User%20-notlike%20%22*Group%20Access*%22%7D%20%7C%20foreach%20%7BRemove-MailboxFolderPermission%20-Identity%20%22Customer%20Mailbox%22%20-User%20%24_%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

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

 

2 Replies
Highlighted

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

Highlighted

@Robert Bollinger 

 

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 $_}