Check Whether POP and IMAP Are Disabled for All Exchange Online Mailboxes
Question details
An administrator needs to verify in bulk that both POP and IMAP are disabled for every Exchange Online mailbox.
- Product
- Microsoft 365 Exchange Online
- Device & OS
- not provided
- Scenario
- Audit mailbox protocol settings across a large organization without opening each mailbox in the Exchange Admin Center.
- Observed behavior
- Individual mailbox checks are inefficient, and an attempted PowerShell connection failed while MFA was enabled.
Use a supported PowerShell environment and an Exchange Online administrator account with permission to read mailbox client-access settings across the organization. Have your administrator sign-in address ready and use the ExchangeOnlineManagement module's interactive connection method to support MFA.
Audit all mailbox POP and IMAP settings with Exchange Online PowerShell
Retrieve mailbox settings in bulk and identify any mailbox where POP or IMAP remains enabled.
Listing only mailboxes where both protocols are disabled does not establish that every mailbox meets that condition. Check for exceptions as well, and confirm that your account's permissions cover the intended organization-wide scope.
Open PowerShell. If the module is not installed, run: Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser Then load it: Import-Module ExchangeOnlineManagement
Run the following command, replacing the example address with your administrator sign-in address: Connect-ExchangeOnline -UserPrincipalName admin@contoso.com Complete the interactive sign-in and any MFA prompts. Do not use an older username-and-password-only connection method.
Run: $mailboxes = @(Get-CASMailbox -ResultSize Unlimited -ErrorAction Stop) $mailboxes | Format-Table DisplayName, PrimarySmtpAddress, PopEnabled, ImapEnabled -AutoSize Confirm that retrieval completed successfully and that the returned mailbox count is plausible for your administrative scope: $mailboxes.Count
Run: $exceptions = @($mailboxes | Where-Object { $_.PopEnabled -eq $true -or $_.ImapEnabled -eq $true }) $exceptions | Format-Table DisplayName, PrimarySmtpAddress, PopEnabled, ImapEnabled -AutoSize $exceptions.Count Any returned mailbox has POP, IMAP, or both enabled. If the exception count is zero, both settings are disabled for all mailboxes in the successfully retrieved report.
To display only mailboxes that satisfy both conditions, run: Get-CASMailbox -ResultSize Unlimited -Filter 'PopEnabled -eq $false -and ImapEnabled -eq $false' | Format-Table Name, PopEnabled, ImapEnabled -AutoSize Use this as a compliant-mailbox list, not as the sole proof that no exceptions exist.
Review Exchange Online Protocol Audit Reports in WPS Spreadsheet
WPS Office does not fix Exchange Online connections or administer mailbox protocols. For reviewing exported audit results, it offers a free, lightweight Microsoft Office alternative with a familiar spreadsheet interface and format compatibility for easy migration. In your connected PowerShell session, run $mailboxes | Select-Object DisplayName, PrimarySmtpAddress, PopEnabled, ImapEnabled | Export-Csv -Path ./mailbox-protocol-audit.csv -NoTypeInformation, then open the CSV through File > Open in WPS Spreadsheet.

Frequently Asked Questions
Does a list of mailboxes with POP and IMAP disabled prove that every mailbox is compliant?
No. A disabled-only filter excludes mailboxes with an enabled protocol. Retrieve all mailbox settings with Get-CASMailbox -ResultSize Unlimited, then filter for PopEnabled or ImapEnabled equal to $true. Zero exceptions confirms compliance only for the successfully retrieved mailboxes within your account's scope.
How do I connect to Exchange Online PowerShell when MFA is enabled?
Load the ExchangeOnlineManagement module and run Connect-ExchangeOnline -UserPrincipalName admin@contoso.com, using your own administrator address. Complete the interactive authentication and MFA prompts. MFA alone does not prevent this supported connection method; if it fails, check the reported error, module version, account permissions, and applicable sign-in policies.
Can I check a single mailbox in the Exchange Admin Center?
Yes. In the Exchange Admin Center, go to Recipients > Mailboxes, select the mailbox, and open the email app settings, typically under Manage email apps settings. Review the POP and IMAP options. Labels may vary as the admin interface changes; PowerShell is more efficient for organization-wide checks.
Do I need to disable POP and IMAP to run this audit?
No. Get-CASMailbox reads the current settings without changing them. If an approved remediation requires disabling both protocols for a specific mailbox, run Set-CASMailbox -Identity user@contoso.com -PopEnabled $false -ImapEnabled $false with appropriate permissions, then check that mailbox again.
How can I save the results for spreadsheet review?
After populating $mailboxes, run $mailboxes | Select-Object DisplayName, PrimarySmtpAddress, PopEnabled, ImapEnabled | Export-Csv -Path ./mailbox-protocol-audit.csv -NoTypeInformation. Open the resulting file using File > Open in WPS Spreadsheet or Microsoft Excel, then filter the protocol columns to review enabled settings.




