Restrict access to Exchange Online
Some days ago, i found myself with a client petition, where they wanted to restrict the access to Exchange Online on a few users only to be able to access their e-mail via OWA. Well after i bit of investigation i found out how to do it via PowerShell, so here are some CmdLets to do so:
Of course, we need to have our environment ready for Office365 administration via PowerShell.
Once we have our system logged on to Office365 via PowerShell with our admin credentials, we can run the following commands as needed:
Disable OWA Access
set-CASmailbox user@domain.com -OWAEnabled $false
Enable OWA Access
set-CASmailbox user@domain.com -OWAEnabled $false
Disable IMAP Access
set-CASMailbox user@domain.com -ImapEnabled $false
Enable IMAP Access
set-CASMailbox user@domain.com -ImapEnabled $true
Disable POP Access
set-CASMailbox user@domain.com -PopEnabled $false
Enable POP Access
set-CASMailbox user@domain.com -PopEnabled $true
Disable Exchange ActiveSync use with mobile devices
set-CASMailbox user@domain.com -ActiveSyncEnabled $false
Enable Exchange ActiveSync use with mobile devices
set-CASMailbox user@domain.com -ActiveSyncEnabled $true
Disable SMS for all the organization
Set-OwaMailboxPolicy Default -TextMessagingEnabled $false
Enable SMS for all the organization
Set-OwaMailboxPolicy Default -TextMessagingEnabled $true
Disable Outlook Access
Set-CASmailbox user@domain.com –mapienabled $false
Enable Outlook Access
Set-CASmailbox user@domain.com –mapienabled $true
I hope you find them useful…