Fix Exchange Online Connection Filtering Access Denied Errors
Question details
The user needs to add an IP address to the Exchange Online connection filter allow list and resolve access-denied errors.
- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- Saving an allowed IP address in connection filtering fails, and the user also cannot establish an Exchange Online PowerShell session.
- Observed behavior
- The settings page reports an organization settings error, while PowerShell returns an access-denied error when creating a session.
Have the IP address or range you want to allow and an account with the required Exchange administrative permissions ready. Record the complete connection error, removing any sensitive information before sharing it.
Add the allowed IP using Exchange Online PowerShell
Use this method when the settings page cannot save the IP address and you have an account authorized to manage the connection filter policy.
Being able to connect to Microsoft 365 PowerShell does not by itself confirm that the account has the permissions needed to connect to Exchange Online or change its policies.
In the Microsoft 365 admin center, open Users > Active users, select the account, and check its assigned roles. An administrator can assign the Exchange Administrator role if appropriate.
In PowerShell, run Install-Module ExchangeOnlineManagement if the module is not installed. Then run Connect-ExchangeOnline and sign in with the authorized account, completing any required authentication prompts.
Run Get-HostedConnectionFilterPolicy to identify the policy name and review its current IP allow list.
Run Set-HostedConnectionFilterPolicy -Identity "Default" -IPAllowList @{Add="203.0.113.10"}, replacing Default with the policy name if needed and 203.0.113.10 with the IP address you intend to allow.
Run Get-HostedConnectionFilterPolicy -Identity "Default" | Format-List Name,IPAllowList, replacing Default with your policy name, and confirm that the address appears.

Investigate a failed Exchange Online PowerShell connection
Use these checks if Connect-ExchangeOnline or an older New-PSSession command returns access denied.
Work with Office files using WPS Office
WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files. It does not manage or fix Exchange Online connection policies.

Frequently Asked Questions
Why can I connect to Microsoft 365 PowerShell but not Exchange Online?
The connections use different services and authorization checks. Verify the account's Exchange role under Users > Active users in the Microsoft 365 admin center, then try Connect-ExchangeOnline.
How do I add an IP without replacing the existing allow list?
Use Set-HostedConnectionFilterPolicy with -IPAllowList @{Add="your-IP-address"}. Replace the placeholder with the intended address and specify the correct policy with -Identity.
What should I do if New-PSSession returns access denied?
Use the ExchangeOnlineManagement module and Connect-ExchangeOnline, then verify the account's Exchange permissions. If the connection still fails, share the sanitized complete error with Microsoft support.
How can I confirm that the IP was added?
Run Get-HostedConnectionFilterPolicy -Identity "Default" | Format-List Name,IPAllowList and check the results. Replace Default if your policy has a different name.




