Disable POP3/IMAP in Exchange Online Office 365

I think most of the customer migrating from on-premise to cloud will have a question. How can I limit the POP3/IMAP access of the employees.

To do this in on-premise is as easy as stopping the IMAP4 service or stop the IMAP4 in Exchange Server Management Application.

However, they may wonder, I do not have the tool in Office 365. How can I be able to achieve.

To do this, you need PowerShell to help you.

First Connect your powershell with Office 365

$Credential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://ps.outlook.com/powershell” -Credential $Credential -Authentication Basic -AllowRedirection

$ImportResults = Import-PSSession $Session

Second, read all user mailboxes and then disable POP and IMAP

$Mailboxes = Get-Mailbox -ResultSize Unlimited

ForEach ($Mailbox in $Mailboxes) {$Mailbox | Set-CASMailbox -PopEnabled $False -ImapEnabled $False }

Finally, close your session to Exchange Online.

Remove-PSSession $Session

For more details of the capabilities of powershell on Exchange Online, please find the following link.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s