Conditional Access Problems

How to Configure Conditional Access for SharePoint Geofencing and MFA

Olivia MillerOlivia Miller Nov 2, 2026 870 views

Question details

The administrator needs to restrict SharePoint and OneDrive access using location-based conditions, allowing passwordless access inside the office while requiring Multi-Factor Authentication (MFA) for external access.

How to Configure Conditional Access for SharePoint Geofencing and MFA
Product
Microsoft 365
Device & OS
not provided
Scenario
Implementing location-based access controls to protect corporate data by requiring MFA only when users attempt to access resources from outside the trusted corporate network.
Observed behavior
Users currently experience either uniform MFA prompts or a lack of enforcement; the goal is to trigger MFA conditionally based on whether the user's IP address matches a trusted office location.
Before you start

Ensure you have Global Administrator, Conditional Access Administrator, or Security Administrator privileges in your Microsoft Entra ID (formerly Azure AD) tenant, and an active Microsoft Entra ID P1 or P2 license.

Solution 1Recommended

Create a Location-Based Conditional Access Policy in Microsoft Entra ID

Use Microsoft Entra ID to define trusted corporate IP ranges and enforce a Conditional Access policy that requires MFA only when SharePoint or OneDrive are accessed from non-trusted locations.

Conditional Access policies evaluate identity signals (like IP address and location) to determine whether a user should be granted access, required to provide additional verification (MFA), or blocked entirely.

By defining your office network as a 'named location' and excluding it from the MFA requirement, you create a seamless login experience for internal employees while protecting data from external threats.

1
Define trusted named locations

Sign in to the Microsoft Entra admin center. Navigate to Protection > Conditional Access > Named locations. Click 'IP ranges location', enter your office public IP addresses, check the 'Mark as trusted location' box, and save.

2
Create a new Conditional Access policy

Go to Protection > Conditional Access > Policies and select 'New policy'. Give the policy a descriptive name, such as 'SharePoint Geofencing and MFA'.

3
Select the target users and applications

Under 'Users', select the specific groups or users this policy should apply to. Under 'Target resources' (or Cloud apps), choose 'Select apps' and search for 'Office 365 SharePoint Online'. This automatically encompasses OneDrive as well.

4
Configure the location conditions

Under 'Conditions', click 'Locations'. Turn the configuration 'On'. Under the 'Include' tab, select 'Any location'. Under the 'Exclude' tab, select 'Selected locations' and choose the trusted IP range you created in the first step.

5
Enforce the MFA requirement

Under 'Access controls' > 'Grant', select 'Grant access' and check the 'Require multifactor authentication' box. Click 'Select' to apply.

6
Enable and test the policy

Set the policy state to 'Report-only' initially to verify its impact via sign-in logs without disrupting users. Once you confirm it works as intended, change the state to 'On' and click 'Save'.

Create a Location-Based Conditional Access Policy in Microsoft Entra ID
Policy Application Time: Conditional Access policies may take a few minutes to propagate across your tenant. Users currently signed in may not be prompted for MFA until their session token expires or they re-authenticate.
Free Microsoft Office alternative

A Powerful and Free Microsoft Office Alternative

While managing enterprise access controls via Microsoft Entra is essential for securing SharePoint, your users also need a fast, reliable, and highly compatible office suite for daily document creation. WPS Office provides a seamless, cost-effective alternative to Microsoft Office desktop applications.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx)Lightweight application that installs quickly and runs smoothly on older devicesFree to use with essential productivity tools and built-in PDF editing capabilitiesFamiliar user interface ensuring a zero-learning-curve transition for your team
microsoft office alternative - wps office

Frequently Asked Questions

Do I need a specific license to use Conditional Access policies?

Yes, creating and enforcing Conditional Access policies requires your tenant to have Microsoft Entra ID P1 or P2 licenses (formerly known as Azure AD Premium P1/P2).

Does targeting SharePoint in the policy automatically cover OneDrive?

Yes. In Microsoft Entra Conditional Access, selecting 'Office 365 SharePoint Online' as the target cloud application applies the same security controls to both SharePoint and OneDrive for Business.

Why are my users still being prompted for MFA when inside the office network?

This usually happens if the public IP address the users are presenting to Microsoft 365 does not exactly match the IP ranges defined in your trusted 'Named locations'. Additionally, ensure there isn't another conflicting Conditional Access policy enforcing MFA globally.

How can I safely test this policy without locking out executives?

You should use the 'Report-only' mode when initially saving the policy. This logs the results of the policy evaluation during user sign-ins without actually enforcing the MFA prompt. You can review the Microsoft Entra sign-in logs to verify the results before switching the policy to 'On'.