Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PowerShell one-liner script to remove email access for one user (disable POP IMAP MAPI OWA ActiveSync and Outlook app for iOS and Android). Tested on Exchange Online.
Set-CASMailbox -Identity -PopEnabled $False -ImapEnabled $False -MAPIEnabled $False -OWAEnabled $False -ActiveSyncEnabled $False -OWAforDevicesEnabled $false -EWSEnabled $False -EwsBlockList @{Add="Outlook-iOS/*","Outlook-Android/*"}
### Re-enable all protocols ###
#Set-CASMailbox -Identity -PopEnabled $true -ImapEnabled $true -MAPIEnabled $true -OWAEnabled $true -ActiveSyncEnabled $true -OWAforDevicesEnabled $true -EWSEnabled $true -EwsBlockList @{Remove="Outlook-iOS/*","Outlook-Android/*"} -EwsApplicationAccessPolicy $null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.