Two engineers checking a tablet between server racks

LIBRARY 1.18Microsoft 365 Security Library

How to Block Sign-Ins from Other Countries in Microsoft 365

If your company only works in the United States, a successful sign-in from abroad deserves a hard stop. Conditional Access can block countries you never expect, and trusted locations need watching too. Here is how to do both safely.

Reviewed by Ali Hassani, C|CISO, CISSP · Last verified November 20, 2026

25+ yearsIT and cybersecurity experience
Certified CISOC|CISO · CISSP · Microsoft · Cisco
Southern CaliforniaBased in Irvine, on-site by appointment
NationwideRemote Microsoft 365 audits

Intelligence Center › Microsoft 365 Security Library › Identity and sign-in

Identity check
Time to fixAbout 30 minutes, plus a report-only week
Staff impactLow to medium: travelers need an exception process
LicensingConditional Access: Entra ID P1 (Business Premium, E3, E5)
Last verifiedNovember 20, 2026, against Microsoft Learn
Works onBusiness BasicBusiness StandardBusiness PremiumE3E5

Country-based blocking uses named locations and Conditional Access, which need Microsoft Entra ID P1 or higher (Microsoft Learn).

In one minute

  1. Create a named location listing the countries you work from.
  2. Create a Conditional Access policy that blocks every location except that list.
  3. Exclude your two emergency accounts and run it in report-only first.
  4. Review trusted IP ranges and remove any you can’t confirm.

Location policies are part of the identity checks in our Microsoft 365 Security Audit.

What it is

How location-based Conditional Access works

Conditional Access decides a user’s location from their public IP address, or from GPS in the Microsoft Authenticator app when you choose that. Named locations can hold IP ranges or countries, and policies can include or exclude them (Microsoft Learn).

Microsoft’s planning guidance recommends listing the countries you do allow and blocking everything else, which is simpler for companies in a few locations, and excluding emergency access accounts (Microsoft Learn).

The two kinds of named location

TypeWhat it holdsWatch out for
Countries locationA list of countries or regions, optionally unknown areasVPNs and cloud proxies show the proxy’s country
IP ranges locationYour office and VPN public IP rangesCan be marked trusted, which can exempt it from policies

Microsoft notes that when a cloud proxy or VPN is used, the IP address evaluated is the proxy’s, not the user’s (Microsoft Learn).

Why it matters

Most attacks don’t come from your city

  1. Password stolenPhishing, spray or reuse.
  2. Sign-in from another countryRight password, wrong place.
  3. Country block policyAccess denied.
  4. Mailbox and files openWithout it: account taken over.
  5. Rules, forwarding, fraudThe attack continues.

Drawing: where a country block breaks the path.

97%

of identity attacks were password attacks in the first half of 2025.

Source: Microsoft Digital Defense Report 2025
1

hour, by default, before a location change is picked up for apps using modern authentication.

Source: Microsoft Learn
195

IP-based named locations allowed per tenant, each with up to 2,000 ranges.

Source: Microsoft Learn
2

emergency access accounts to exclude, so a bad policy can’t lock everyone out.

Source: Microsoft Learn

What a country block does and doesn’t do

SituationBlocked?What else helps
Attacker signs in from an unexpected countryYesKeep MFA on too
Attacker uses a VPN in your own countryNoMFA and risk-based policies
Attacker’s range added as a trusted locationNoAlerts on named location changes
Employee travelling abroadYes, unless exceptedA time-limited exception group

Microsoft notes that Conditional Access is enforced after the first sign-in factor, so it isn’t a defense against denial-of-service attacks (Microsoft Learn).

What we find in audits

What this finding looks like in our audit reports

These are real pages from our published sample reports, written for fictional companies. Click any page to open it full size.

Compromise Assessment · Technical ReportSAMPLE · Contoso Ltd is a fictional company1 / 4
Compromise Assessment · Technical Report, Page 60 · Finding F-75: The finding, ready to act on.
The finding, ready to act on. In our compromise assessment sample, two accounts signed in successfully from countries where the company does not operate.

Your options

What each plan gives you

CapabilityBusiness Basic and StandardEntra ID P1 (Business Premium, E3)Entra ID P2 (E5)
Named locations and country blocksNoYesYes
Trusted IP rangesNoYesYes
Sign-in logs showing locationYesYesYes
Risk-based policies (unfamiliar location, impossible travel)NoNoYes

Without Conditional Access, review sign-in logs for foreign sign-ins regularly and make sure MFA is on for everyone.

How to check it yourself

See your location policies and trusted ranges, without changing anything

Look for a countries location and a policy that uses it. Check every IP range marked Trusted against your real office and VPN addresses.

Read-only PowerShell: named locations and trusted ranges

Connect-MgGraph -Scopes "Policy.Read.All"
Get-MgIdentityConditionalAccessNamedLocation |
  Select-Object DisplayName, ModifiedDateTime,
    @{n="Trusted";e={$_.AdditionalProperties.isTrusted}},
    @{n="Countries";e={$_.AdditionalProperties.countriesAndRegions -join ","}}

The command only reads settings. A trusted range nobody recognizes, or one changed recently, needs checking first.

How to configure

How to block sign-ins from other countries, step by step

Entra ID P1 or P2

Create the block

  1. In Named locations, select Countries location, name it Allowed countries, and select the countries you work from.
  2. Create a Conditional Access policy for All users, excluding your two emergency access accounts.
  3. Target All resources; under Network, include Any network or location and exclude Allowed countries.
  4. Set Grant to Block access and the policy to Report-only.
  5. After a week of clean results, switch it to On.

Keep it honest

Travel and trusted ranges

  1. Create a travel exception group with time-limited membership.
  2. Remove the trusted flag from any IP range you can’t confirm.
  3. Alert on every change to named locations and Conditional Access.
  4. Review foreign sign-ins weekly in the sign-in logs.

What your users will notice

Nothing at home. Travelers abroad are blocked unless they’re in the exception group, so tell staff to ask before trips.

How to undo it

Set the policy back to Report-only or Off. Deleted policies and locations can be restored for 30 days.

Proof and questions

How to prove it is fixed, and what to ask your IT provider

Evidence it is fixed

  • An allowed-countries policy is On, with only emergency accounts excluded.
  • Report-only results reviewed before enforcement.
  • Every trusted IP range matches a known office or VPN.
  • An alert fires on named location changes.

Questions for your IT provider

  • Do we block sign-ins from countries we don’t work in?
  • Who is excluded from that policy, and why?
  • Which IP ranges are marked trusted, and who owns them?
  • How do travelers get access?
  • Have we had successful foreign sign-ins this month?

Signs it was already abused

If a foreign sign-in may already have succeeded, look for these signs

Red flags

  • Successful sign-ins from countries nobody travelled to.
  • A trusted location added or changed without a ticket.
  • Sign-ins from new countries followed by new MFA methods.
  • Inbox rules or forwarding created soon after a foreign sign-in.
  • Disabled or edited location policies.

If you see these, reset the password, revoke sessions and keep the logs. Our account takeover investigation establishes what was reached, and the Microsoft 365 Evidence Clock shows how long the records are kept.

Framework mapping

Where location policies fit

FrameworkWhere it fits
NIST CSF 2.0PR.AA-03: authentication; DE.CM-01: monitoring
ISO/IEC 27001:2022Annex A 8.5 Secure authentication; 8.16 Monitoring activities
SOC 2CC6.1 logical access; CC6.6 protection against outside threats

Reviewed by

Written and reviewed by a practicing CISO

Ali Hassani, CISO and founder of OC Security Audit

Ali Hassani, C|CISO, CISSP

Ali has more than 25 years of IT and cybersecurity experience and holds the Certified CISO and CISSP certifications along with Microsoft and Cisco credentials. He leads every OC Security Audit engagement from Irvine, on-site across Southern California and remotely nationwide. Every Microsoft 365 audit is read-only.

FAQ

Frequently asked questions about country blocking

Can Microsoft 365 block sign-ins by country?

Yes, with a Conditional Access policy that uses a countries named location. It needs Microsoft Entra ID P1, included in Business Premium, E3 and E5.

Should I block bad countries or allow good ones?

Microsoft recommends listing the countries you allow and blocking everything else, which is simpler for most small and mid-size companies.

Does a VPN get around it?

Yes, if the VPN exits in an allowed country. Keep MFA and risk-based policies on as well.

What's a trusted location?

An IP range marked trusted. Policies can exempt it, so an attacker's range added as trusted is dangerous. Review them regularly.

What about staff who travel?

Put them in a time-limited exception group before the trip, and remove them when they return.

Which plans include this?

Conditional Access needs Entra ID P1: Business Premium, E3 or E5.

Next step

Keep sign-ins where your business is

Prevent

Microsoft 365 Security Audit

$3,500 fixed

About 200 read-only checks across sign-in protection, email, sharing and devices, for any tenant size, with four reports and a remediation roadmap.

Respond

Microsoft 365 & Azure Compromise Investigation

From $3,500

For when an account signed in from somewhere it shouldn’t: we establish what was reached.

Want to see the deliverables first? Open the Microsoft 365 audit sample report or browse all our sample reports.

Related reading: How to turn on risk-based Conditional Access · How to move policies from report-only to on · How to set up emergency access accounts

Sources

Sources used on this page

  1. Microsoft Learn, Block access by location
  2. Microsoft Learn, Conditional Access: Network assignment
  3. Microsoft Learn, Plan a Conditional Access deployment
  4. Microsoft Source, Microsoft releases 2025 Digital Defense Report

This guide is general information, not a guarantee of protection or legal advice. Microsoft changes its admin centers often: menu names and steps were checked against Microsoft Learn on November 20, 2026. Drawings are simplified and are not screenshots of Microsoft products. Sample findings come from fictional companies. Incidents are described as reported by the cited sources; OC Security Audit was not involved in them. Questions? Call 949-777-5567 or email support@ocsecurityaudit.com.