Block Microsoft 365 Sign-Ins from Specific IP Addresses
Question details
An administrator wants to block Microsoft 365 sign-ins from specific IP addresses or ranges.

- Product
- Microsoft 365 and Microsoft Entra ID Conditional Access
- Device & OS
- not provided
- Scenario
- The administrator wants to restrict access to Microsoft 365 services based on the source IP address of a sign-in.
- Observed behavior
- Sign-ins from selected IP addresses or ranges should be blocked by a Conditional Access policy.
Confirm that the affected users have the required Microsoft Entra ID P1 or eligible bundled licenses and that you have an appropriate Conditional Access administrator role. Collect the public IP addresses or ranges in CIDR notation, and identify an emergency access account to exclude from the policy.
Block selected IP ranges with Microsoft Entra Conditional Access
Create a named location for the unwanted IP ranges, then apply a block policy to Microsoft 365 sign-ins from that location.
Conditional Access evaluates the public IP address seen by Microsoft Entra ID, which may be a VPN or proxy address rather than the device's local IP address. It controls access after authentication; it does not prevent someone from submitting a sign-in attempt.
Sign in to the Microsoft Entra admin center and open Protection > Conditional Access > Named locations. Select IP ranges location, enter a name, add the public IP addresses or ranges in CIDR notation, and save.
Open Protection > Conditional Access > Policies and select New policy. Give the policy a descriptive name.
Under Users, include the users or groups you want to protect and exclude your emergency access account. Under Target resources, select Cloud apps and choose the Office 365 app group.
Under Conditions > Locations, enable the condition and include the named location you created. Under Grant, select Block access, then choose Select.
Set Enable policy to Report-only and create the policy. Review the Report-only results in Microsoft Entra sign-in logs and use the Conditional Access What If tool to check expected matches. When the results are correct, edit the policy and set Enable policy to On.

Work with Microsoft Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Microsoft Office file formats, making it easy to move everyday document work. It does not replace Microsoft Entra Conditional Access or block Microsoft 365 sign-ins.

Frequently Asked Questions
Can Conditional Access stop someone from attempting to sign in?
No. Conditional Access can block access when a sign-in matches the policy, but it does not stop someone from submitting credentials. Review attempts in Microsoft Entra admin center under Monitoring & health > Sign-in logs.
How do I add a single IP address to a named location?
In Conditional Access > Named locations, create or edit an IP ranges location and add the public address in CIDR notation, such as /32 for a single IPv4 address or /128 for a single IPv6 address.
Why is a legitimate user matching the blocked location?
Microsoft Entra ID evaluates the public source IP it sees. Check the IP address in the user's sign-in log; a shared VPN, proxy, or network gateway may use an address included in the blocked range.
Will report-only mode block sign-ins?
No. Report-only mode evaluates the policy without enforcing it. Check the Report-only results in the sign-in logs, then switch Enable policy to On when you are ready to enforce it.




