Configuring Named Locations

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 11 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Configuring Named Locations in Microsoft Entra ID

Introduction: Understanding Identity Perimeters

In the modern landscape of cloud computing, the traditional "castle and moat" security model—where everything inside the corporate network is trusted and everything outside is suspicious—has become obsolete. As organizations adopt remote work, mobile devices, and software-as-a-service (SaaS) applications, the identity of the user has become the new security perimeter. However, identity alone is not enough. To create a truly resilient security posture, we must consider the context in which an identity attempts to access resources.

Named Locations in Microsoft Entra ID (formerly Azure Active Directory) provide a fundamental mechanism for defining these contexts. By labeling specific IP ranges, countries, or regions as "known" or "trusted," administrators can create granular policies that adjust security requirements based on where a request originates. This is the cornerstone of Conditional Access; it allows you to demand stricter authentication methods (like multi-factor authentication) for users traveling abroad while allowing simplified access for employees working from a secure corporate office.

Understanding how to configure and manage these locations is not just a checkbox exercise for compliance; it is a vital skill for reducing the attack surface of your organization. This lesson will guide you through the technical implementation of Named Locations, the logic behind their integration with Conditional Access, and the best practices for maintaining a secure identity environment.


Not read yet

What are Named Locations?

At its core, a Named Location is a logical grouping of network properties that Microsoft Entra ID uses to evaluate access requests. When a user logs in, the service inspects the source IP address of the request. If that IP address matches a definition you have created in your Named Locations, the system marks that request with a specific label.

There are two primary types of Named Locations in Entra ID:

  1. IP-based Locations: These are defined by specific public IPv4 or IPv6 address ranges (CIDR blocks). They are typically used to represent your corporate offices, branch locations, or specific VPN head-ends.
  2. Country-based Locations: These are defined by geo-location data associated with IP addresses. While less precise than specific IP ranges, they are incredibly useful for blocking access from entire regions where your organization has no business presence.

Why Context Matters

Imagine a user account is compromised. If an attacker in a different country attempts to sign in, and you have configured a Conditional Access policy that blocks access from countries where you do not operate, the attack is stopped immediately. Conversely, if an employee is working from the office, you might choose to bypass multi-factor authentication (MFA) to improve user experience, knowing that the physical security of the building provides an additional layer of protection.

Callout: Named Locations vs. Trusted IPs It is important to distinguish between "Named Locations" and the legacy "Trusted IPs" setting in the MFA service. While Trusted IPs were once the standard for identifying office networks, they have been deprecated in favor of Named Locations. Named Locations are more flexible, support IPv6, and integrate directly into the Conditional Access engine, providing a unified management experience for all authentication signals.


Not read yet

Configuring IP-Based Named Locations

IP-based locations are the most common implementation. They allow you to define the exact boundaries of your physical network.

Step-by-Step: Adding an IP Named Location

  1. Sign in to the Microsoft Entra admin center using an account with at least a Conditional Access Administrator role.
  2. Navigate to Protection > Conditional Access > Named locations.
  3. Click on + IP ranges location.
  4. Provide a Name that is descriptive (e.g., "London HQ - Primary Office").
  5. Enter the IP ranges in CIDR notation (e.g., 192.168.1.0/24).
  6. Check the box labeled Mark as trusted location if this network is managed by your organization and considered secure.
  7. Click Create.

Best Practices for IP Ranges

When defining your IP ranges, ensure you are using the public-facing IP addresses of your network, not the internal private addresses. If you have a large organization with many branch offices, keep a well-documented spreadsheet of your public IP ranges to avoid configuration drift.

Tip: Public vs. Private IPs Remember that the Entra ID service sees the request coming from your ISP's public IP address, not your internal workstation IP. If you use a NAT (Network Address Translation) device, ensure you are using the egress IP address of that device in your Named Location definitions.


Not read yet

Configuring Country-Based Named Locations

Country-based locations allow you to categorize access by geographical origin. This is particularly effective for "geo-fencing" your applications.

How Geo-Location Works

Microsoft Entra ID uses a third-party mapping service that correlates IP addresses with physical locations. Because IP addresses are dynamic and can be reallocated, this method is not 100% accurate, but it is highly effective for broad security policies.

Step-by-Step: Adding a Country Named Location

  1. Navigate to Protection > Conditional Access > Named locations.
  2. Click on + Countries location.
  3. Provide a Name (e.g., "Region - Blocked Countries").
  4. Select the countries from the list. You can select entire continents or specific nations.
  5. Decide whether you want to Include unknown areas. This is crucial because some IP addresses do not map correctly to a specific country. If you are creating a "Block" policy, you may want to include unknown areas to be safe, but be careful not to lock out legitimate users.
  6. Click Create.

Not read yet

Integrating Named Locations with Conditional Access

Defining a location does nothing on its own. To enforce security, you must use these locations within a Conditional Access policy.

The Logic of Conditional Access

Conditional Access follows a simple "If-Then" logic:

  • Assignments (The "If"): Who is the user? What app are they accessing? What is the risk level? Where are they located?
  • Access Controls (The "Then"): Block access, Grant access, or Require MFA/Password change.

Scenario: Restricting Access to Sensitive Data

Suppose you want to ensure that access to your Human Resources application is only possible from your corporate office.

  1. Create a new Conditional Access Policy.
  2. Under Users, select the group of users who need access to HR data.
  3. Under Target resources, select the specific application (e.g., "Workday" or "HR Portal").
  4. Under Conditions > Locations, select Include and choose your "Corporate Office" Named Location.
  5. Under Access Controls, select Grant and ensure access is allowed.
  6. Crucial Step: In the Locations condition, you must ensure that everything outside of your corporate office is implicitly blocked by a separate policy or by setting the "Grant" control to "Block" for all other locations.

Warning: The "Lockout" Risk Always test your policies in "Report-only" mode before enforcing them. If you create a policy that blocks access based on location and you incorrectly define your IP ranges, you could inadvertently lock your entire organization out of the portal, including the administrators. Use the Conditional Access "What If" tool to simulate the policy before enabling it.


Not read yet

Comparison of Location Types

Feature IP-Based Locations Country-Based Locations
Precision High (Exact CIDR) Moderate (IP Mapping)
Use Case Trusted office networks Geo-fencing/Risk reduction
Maintenance High (Requires IP tracking) Low (Managed by Microsoft)
Reliability Very High Variable (VPNs/Proxies bypass)

Common Pitfalls and How to Avoid Them

1. The VPN Problem

Many organizations use VPNs to allow remote workers to access internal resources. If a user connects to a corporate VPN, their traffic might be routed through your corporate data center, meaning the request will appear to come from your corporate IP range. While this makes the user "trusted" by your location policy, it may bypass other security checks. Ensure your VPN infrastructure is secure and that you are not accidentally granting "trusted" status to remote users who have not passed secondary authentication.

2. Ignoring IPv6

Many administrators focus exclusively on IPv4. However, modern traffic often utilizes IPv6. If you only define IPv4 ranges, a user coming from an IPv6 connection will not be recognized as being in your "Trusted" location, leading to unexpected MFA prompts. Always check your network infrastructure to see if IPv6 is active and include those ranges if necessary.

3. Relying on Location as the Sole Security Factor

Location is a signal, not a guarantee. An attacker can use a proxy server or a VPN to make it appear as if they are connecting from your corporate office. Never rely solely on Named Locations for security. Always combine location-based policies with other signals, such as device compliance (Intune) or user risk (Entra ID Protection).

4. Lack of Documentation

IP addresses change, ISPs reconfigure their networks, and offices move. If you do not keep a clear record of why a specific IP range is marked as "Trusted," you will eventually run into a situation where an old, insecure network is still permitted to bypass MFA. Conduct a quarterly audit of your Named Locations to remove stale entries.


Not read yet

Practical Examples and Implementation Scenarios

Scenario A: The "Traveler" Policy

You have a sales team that frequently travels internationally. You want to ensure that when they are abroad, they are forced to use MFA, but when they are in their home country, they can use a simpler authentication flow.

  • Policy 1: Require MFA for all users, but exclude the "Home Country" Named Location.
  • Policy 2: Require MFA for all users, including those in the "Home Country" who are flagged as "High Risk."

This layered approach ensures that even if a user is "trusted" by location, their behavior is still monitored for suspicious activity.

Scenario B: Blocking Malicious Regions

If your organization only conducts business in North America, you can create a policy that blocks all sign-in attempts from countries in other regions.

  1. Create a Named Location called "Allowed Countries" and select only the countries where you operate.
  2. Create a Conditional Access policy.
  3. Set the Locations condition to "Any location" and Exclude the "Allowed Countries" location.
  4. Set the Access Control to "Block access."

This effectively creates a "Deny-by-Default" posture for the rest of the world.


Not read yet

Advanced Management: Using PowerShell

For large organizations with hundreds of branch offices, manually entering IP ranges in the UI is inefficient. You can manage Named Locations using the Microsoft Graph PowerShell SDK.

Code Example: Creating a Named Location

First, ensure you have the Microsoft.Graph module installed and connected.

# Define the parameters for the new location
$params = @{
    "@odata.type" = "#microsoft.graph.ipNamedLocation"
    displayName = "New York Branch Office"
    isTrusted = $true
    ipRanges = @(
        @{
            "@odata.type" = "#microsoft.graph.iPv4CidrRange"
            cidrAddress = "192.0.2.0/24"
        }
    )
}

# Create the location
New-MgIdentityConditionalAccessNamedLocation -BodyParameter $params

Explanation of the Script

  • @odata.type: This specifies the object type. For IPs, we use #microsoft.graph.ipNamedLocation.
  • isTrusted: Setting this to $true allows you to use this location for MFA bypass policies.
  • ipRanges: This is an array, meaning you can add multiple CIDR blocks to a single Named Location object, which is helpful if your office uses multiple subnets.

Note: Always verify your changes after running scripts. Use Get-MgIdentityConditionalAccessNamedLocation to list all current locations and confirm that the new object appears with the correct properties.


Not read yet

Best Practices Summary

  • Use Descriptive Names: Avoid generic names like "Office1." Use "London_HQ_Main" or "Branch_Berlin_VPN" to make auditing easier.
  • Leverage Report-Only Mode: Before moving a policy to "On," always use the report-only mode to see how many users would have been blocked or prompted for MFA.
  • Keep it Lean: Do not create a Named Location for every single minor subnet if they can be aggregated into a larger range. This reduces the administrative overhead.
  • Audit Regularly: Schedule a review every 90 days to ensure that the IP addresses in your list are still valid and owned by your organization.
  • Combine Signals: As mentioned, location is just one part of the puzzle. Always layer it with device status, user risk, and sign-in risk signals.

Troubleshooting Common Issues

"Why am I being prompted for MFA even though I'm in the office?"

  1. Check the Sign-in Logs: Go to Entra ID > Monitoring > Sign-in logs. Find the failed or prompted sign-in event.
  2. Examine the "Location" tab: See what IP address Entra ID recorded for that session.
  3. Compare to Named Locations: Check if that specific IP address is actually covered by one of your defined Named Locations. Often, the issue is that the user's traffic is exiting through a different ISP gateway than the one you defined.
  4. Check for IPv6: If the recorded IP is an IPv6 address, ensure you have added that address range to your Named Location.

"I created a block policy but users are still getting in."

  1. Policy Order: Conditional Access policies are processed in order. If you have a policy that grants access before your block policy, the block policy will never be evaluated. Check the policy priority in the Conditional Access blade.
  2. Exclusions: Check if the user is part of a group that you excluded from the policy.
  3. Session Persistence: If a user was already signed in before you enabled the policy, their session might still be active. Policies usually apply to new sign-in attempts.

Not read yet

Frequently Asked Questions (FAQ)

Q: Can I use Named Locations for things other than Conditional Access? A: Currently, Named Locations are primarily designed for Conditional Access. However, they are also used by Entra ID Protection to identify "Impossible Travel" scenarios. If a user signs in from two different locations in a short time, and one of those is a "Trusted" location, the system can use that information to refine its risk calculation.

Q: Does a Named Location apply to guest users? A: Yes. Conditional Access policies apply to all identities in your tenant, including B2B guest users. If you have a policy that restricts access based on location, that policy will also apply to guests attempting to access your resources.

Q: What is the maximum number of Named Locations I can have? A: There is a limit to the number of Named Locations and the number of IP ranges you can define. While the limit is quite high (hundreds of locations), you should strive to keep your configuration clean and organized. If you have thousands of IP ranges, you may need to reconsider your network architecture or aggregate them into larger CIDR blocks.

Q: Should I block all countries except my own? A: While this is a common security practice, it can be disruptive. If your employees travel frequently, or if you use third-party services that utilize globally distributed servers, you might inadvertently block legitimate traffic. Start with a "Report-only" policy to see what would be blocked before moving to active enforcement.


Not read yet

Key Takeaways

  1. Identity is the Perimeter: In the cloud-first world, location is a vital piece of context that defines how an identity should be treated.
  2. Define Locations Carefully: Use IP-based locations for specific, controlled networks and country-based locations for broad geographical governance.
  3. Trust is Earned: Only mark a location as "Trusted" if you have complete control over the network security of that location. Never mark public Wi-Fi or home networks as trusted.
  4. Layered Security: Named Locations should never be your only security control. Always combine location data with MFA, device compliance, and risk-based signals for a robust defense.
  5. Test Before Enforcing: Always use the "Report-only" mode and the "What If" tool in Conditional Access to simulate the impact of your policies. This prevents self-inflicted lockouts and ensures a smooth user experience.
  6. Maintain Hygiene: Treat your Named Locations as configuration-as-code. Document why each location exists, who owns the IP ranges, and perform regular audits to remove obsolete entries.
  7. Consider IPv6: Modern network traffic is increasingly using IPv6. Ensure your location definitions account for modern networking standards to avoid gaps in your security coverage.

By mastering the configuration of Named Locations, you move beyond basic password-based security and into the realm of intelligent, context-aware access management. This not only protects your organization from unauthorized access but also enables a more flexible, productive environment for your legitimate users.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.