LiveFor M365 & identity admins

Conditional Access Policy Planner

Builds a baseline set of Microsoft Entra Conditional Access policies (MFA, legacy authentication, device compliance, risk) from your licensing and requirements, with break-glass accounts covered.

Runs in your browser. Your data never leaves this device.
~/apps/conditional-access-plannerruns in your browser · nothing uploaded
Your Entra ID licence
Identity
Devices and locations
Compliant (Intune) or hybrid-joined Windows and Mac. Needs devices enrolled first.
Two-letter codes, e.g. RU, KP, IR. Leave empty to skip
Risk-based (P2)
 
Excluded from every policy so you can’t lock yourself out

6 policies

NameWhyLicence
CA001-Admins-AllApps-RequirePhishingResistantMFAAdmin accounts are the most valuable target. Phishing-resistant MFA (FIDO2 keys, Windows Hello, passkeys) stops token-phishing kits that defeat app prompts.P1
CA002-AllUsers-AllApps-RequireMFAMFA blocks the vast majority of password-spray and credential-stuffing attacks.P1
CA003-AllUsers-LegacyAuth-BlockLegacy protocols (IMAP, POP, SMTP AUTH, older Office clients) can’t do MFA, so attackers use them to bypass it.P1
CA004-Guests-AllApps-RequireMFAGuests sign in with accounts you don’t manage, so you can’t rely on their home tenant’s security.P1
CA005-AllUsers-AzureManagement-RequireMFACovers the Azure portal, Azure CLI and PowerShell, where anyone with an Azure role can change resources.P1
CA006-Admins-AllApps-SignInEvery4HoursShorter admin sessions and no “stay signed in” limit how long a stolen admin session cookie is useful.P1
Roll-out plan
  1. Create two cloud-only break-glass accounts with FIDO2 keys and add them to “CA-Exclude-BreakGlass”. Alert on any sign-in by them.
  2. Run the script: every policy is created in report-only mode, so nothing changes for users yet.
  3. Leave it a week, then review Entra sign-in logs → Conditional Access → Report-only results, and the Conditional Access insights workbook.
  4. Make sure users have registered MFA (Authentication methods → User registration details) before you enforce the all-users MFA policy.
  5. Switch policies on one at a time, admin policies first, legacy-auth block next, then all-users MFA.
  6. Turn off Security defaults once your Conditional Access policies are enforced (the two can’t run together).
PowerShell (Microsoft Graph)
# Conditional Access baseline: generated by techieshelp.com. Review before running.
# Policies are created in report-only mode. Check sign-in logs (Conditional Access tab) before switching them on.
# Install-Module Microsoft.Graph -Scope CurrentUser   # once
Connect-MgGraph -Scopes 'Policy.ReadWrite.ConditionalAccess', 'Policy.Read.All', 'Group.ReadWrite.All', 'Application.Read.All' -NoWelcome

# 1. Break-glass exclusion group (put your 2 emergency access accounts in it, cloud-only, with FIDO2 keys)
$bgName = 'CA-Exclude-BreakGlass'
$bg = Get-MgGroup -All | Where-Object DisplayName -eq $bgName | Select-Object -First 1
if (-not $bg) {
  $bg = New-MgGroup -DisplayName $bgName -MailEnabled:$false -MailNickname ($bgName -replace '[^a-zA-Z0-9]', '') -SecurityEnabled:$true -Description 'Excluded from all Conditional Access policies. Emergency access accounts only.'
  Write-Warning "Created $bgName. Add your break-glass accounts to it BEFORE enabling any policy."
}

# 3. Policies (skips any that already exist by name)
$policies = @(
@'
{
  "displayName": "CA001-Admins-AllApps-RequirePhishingResistantMFA",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeRoles": [
        "62e90394-69f5-4237-9190-012177145e10",
        "e8611ab8-c189-46e8-94e1-60213ab1f814",
        "7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
        "194ae4cb-b126-40b2-bd5b-6091b380977d",
        "b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
        "29232cdf-9323-42fd-ade2-1d097af3e4de",
        "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
        "fe930be7-5e62-47db-91af-98c3a49a38b1",
        "729827e3-9c14-49f7-bb1b-9608f156bbb8",
        "c4e39bd9-1100-46d3-8c65-fb160da0071f",
        "9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
        "158c047a-c907-4556-b7ef-446551a6b5f7",
        "3a2c62db-5318-420d-8d74-23affee5d9d5",
        "b0f54661-2d74-4c50-afa3-1ec803f12efe"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "All"
      ]
    },
    "clientAppTypes": [
      "all"
    ]
  },
  "grantControls": {
    "operator": "OR",
    "authenticationStrength": {
      "id": "00000000-0000-0000-0000-000000000004"
    }
  }
}
'@,
@'
{
  "displayName": "CA002-AllUsers-AllApps-RequireMFA",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeUsers": [
        "All"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "All"
      ]
    },
    "clientAppTypes": [
      "all"
    ]
  },
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "mfa"
    ]
  }
}
'@,
@'
{
  "displayName": "CA003-AllUsers-LegacyAuth-Block",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeUsers": [
        "All"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "All"
      ]
    },
    "clientAppTypes": [
      "exchangeActiveSync",
      "other"
    ]
  },
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "block"
    ]
  }
}
'@,
@'
{
  "displayName": "CA004-Guests-AllApps-RequireMFA",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeUsers": [
        "GuestsOrExternalUsers"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "All"
      ]
    },
    "clientAppTypes": [
      "all"
    ]
  },
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "mfa"
    ]
  }
}
'@,
@'
{
  "displayName": "CA005-AllUsers-AzureManagement-RequireMFA",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeUsers": [
        "All"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "797f4846-ba00-4fd7-ba43-dac1f8f63013"
      ]
    },
    "clientAppTypes": [
      "all"
    ]
  },
  "grantControls": {
    "operator": "OR",
    "builtInControls": [
      "mfa"
    ]
  }
}
'@,
@'
{
  "displayName": "CA006-Admins-AllApps-SignInEvery4Hours",
  "state": "enabledForReportingButNotEnforced",
  "conditions": {
    "users": {
      "includeRoles": [
        "62e90394-69f5-4237-9190-012177145e10",
        "e8611ab8-c189-46e8-94e1-60213ab1f814",
        "7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
        "194ae4cb-b126-40b2-bd5b-6091b380977d",
        "b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
        "29232cdf-9323-42fd-ade2-1d097af3e4de",
        "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
        "fe930be7-5e62-47db-91af-98c3a49a38b1",
        "729827e3-9c14-49f7-bb1b-9608f156bbb8",
        "c4e39bd9-1100-46d3-8c65-fb160da0071f",
        "9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
        "158c047a-c907-4556-b7ef-446551a6b5f7",
        "3a2c62db-5318-420d-8d74-23affee5d9d5",
        "b0f54661-2d74-4c50-afa3-1ec803f12efe"
      ],
      "excludeGroups": [
        "{{BREAK_GLASS_GROUP_ID}}"
      ]
    },
    "applications": {
      "includeApplications": [
        "All"
      ]
    },
    "clientAppTypes": [
      "all"
    ]
  },
  "sessionControls": {
    "signInFrequency": {
      "isEnabled": true,
      "value": 4,
      "type": "hours",
      "frequencyInterval": "timeBased"
    },
    "persistentBrowser": {
      "isEnabled": true,
      "mode": "never"
    }
  }
}
'@
)
foreach ($json in $policies) {
  $json = $json.Replace('{{BREAK_GLASS_GROUP_ID}}', $bg.Id)
  $body = $json | ConvertFrom-Json -AsHashtable
  $exists = Get-MgIdentityConditionalAccessPolicy -All | Where-Object DisplayName -eq $body.displayName
  if ($exists) { Write-Host "Exists: $($body.displayName)"; continue }
  New-MgIdentityConditionalAccessPolicy -BodyParameter $body | Out-Null
  Write-Host "Created: $($body.displayName)"
}

Disconnect-MgGraph | Out-Null
Policy JSON (Graph API)
[
  {
    "displayName": "CA001-Admins-AllApps-RequirePhishingResistantMFA",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeRoles": [
          "62e90394-69f5-4237-9190-012177145e10",
          "e8611ab8-c189-46e8-94e1-60213ab1f814",
          "7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
          "194ae4cb-b126-40b2-bd5b-6091b380977d",
          "b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
          "29232cdf-9323-42fd-ade2-1d097af3e4de",
          "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
          "fe930be7-5e62-47db-91af-98c3a49a38b1",
          "729827e3-9c14-49f7-bb1b-9608f156bbb8",
          "c4e39bd9-1100-46d3-8c65-fb160da0071f",
          "9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
          "158c047a-c907-4556-b7ef-446551a6b5f7",
          "3a2c62db-5318-420d-8d74-23affee5d9d5",
          "b0f54661-2d74-4c50-afa3-1ec803f12efe"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "All"
        ]
      },
      "clientAppTypes": [
        "all"
      ]
    },
    "grantControls": {
      "operator": "OR",
      "authenticationStrength": {
        "id": "00000000-0000-0000-0000-000000000004"
      }
    }
  },
  {
    "displayName": "CA002-AllUsers-AllApps-RequireMFA",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeUsers": [
          "All"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "All"
        ]
      },
      "clientAppTypes": [
        "all"
      ]
    },
    "grantControls": {
      "operator": "OR",
      "builtInControls": [
        "mfa"
      ]
    }
  },
  {
    "displayName": "CA003-AllUsers-LegacyAuth-Block",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeUsers": [
          "All"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "All"
        ]
      },
      "clientAppTypes": [
        "exchangeActiveSync",
        "other"
      ]
    },
    "grantControls": {
      "operator": "OR",
      "builtInControls": [
        "block"
      ]
    }
  },
  {
    "displayName": "CA004-Guests-AllApps-RequireMFA",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeUsers": [
          "GuestsOrExternalUsers"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "All"
        ]
      },
      "clientAppTypes": [
        "all"
      ]
    },
    "grantControls": {
      "operator": "OR",
      "builtInControls": [
        "mfa"
      ]
    }
  },
  {
    "displayName": "CA005-AllUsers-AzureManagement-RequireMFA",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeUsers": [
          "All"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "797f4846-ba00-4fd7-ba43-dac1f8f63013"
        ]
      },
      "clientAppTypes": [
        "all"
      ]
    },
    "grantControls": {
      "operator": "OR",
      "builtInControls": [
        "mfa"
      ]
    }
  },
  {
    "displayName": "CA006-Admins-AllApps-SignInEvery4Hours",
    "state": "enabledForReportingButNotEnforced",
    "conditions": {
      "users": {
        "includeRoles": [
          "62e90394-69f5-4237-9190-012177145e10",
          "e8611ab8-c189-46e8-94e1-60213ab1f814",
          "7be44c8a-adaf-4e2a-84d6-ab2649e08a13",
          "194ae4cb-b126-40b2-bd5b-6091b380977d",
          "b1be1c3e-b65d-4f19-8427-f6fa0d97feb9",
          "29232cdf-9323-42fd-ade2-1d097af3e4de",
          "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
          "fe930be7-5e62-47db-91af-98c3a49a38b1",
          "729827e3-9c14-49f7-bb1b-9608f156bbb8",
          "c4e39bd9-1100-46d3-8c65-fb160da0071f",
          "9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3",
          "158c047a-c907-4556-b7ef-446551a6b5f7",
          "3a2c62db-5318-420d-8d74-23affee5d9d5",
          "b0f54661-2d74-4c50-afa3-1ec803f12efe"
        ],
        "excludeGroups": [
          "{{BREAK_GLASS_GROUP_ID}}"
        ]
      },
      "applications": {
        "includeApplications": [
          "All"
        ]
      },
      "clientAppTypes": [
        "all"
      ]
    },
    "sessionControls": {
      "signInFrequency": {
        "isEnabled": true,
        "value": 4,
        "type": "hours",
        "frequencyInterval": "timeBased"
      },
      "persistentBrowser": {
        "isEnabled": true,
        "mode": "never"
      }
    }
  }
]

A starting baseline modelled on Microsoft’s recommended policies, not a complete design. Group IDs are filled in by the script; in the JSON they appear as {{placeholders}}. Role IDs and Graph schema checked against Microsoft Learn, December 2026. Nothing you choose leaves your browser.

What it does

  • A baseline in minutesUp to 10 Microsoft-recommended Conditional Access policies from a few choices: admin MFA, all-user MFA, legacy auth, guests, devices, countries and risk.
  • Matches your licenceFree tenants get Security defaults advice; P1 and P2 unlock device and risk-based policies.
  • Ready to deployA Microsoft Graph PowerShell script that creates the break-glass group, a named location and every policy, plus the raw JSON.
  • Report-only firstPolicies are created in report-only mode with a step-by-step rollout plan, so nobody gets locked out.

How to use it

  1. Choose your Entra ID licence

    P1 comes with Business Premium and E3; P2 with E5.

  2. Tick the policies you want

    The defaults are a sensible baseline.

  3. Download and run the PowerShell script

    Policies are created in report-only mode.

  4. Follow the rollout plan

    Review the report-only results for a week, then switch policies on one at a time.

Questions people ask

What is a break-glass account?

An emergency access account excluded from Conditional Access, so you can still sign in if a policy or MFA service goes wrong. Microsoft recommends two cloud-only accounts with strong passwords or FIDO2 keys, monitored for any sign-in.

Should I use Security defaults or Conditional Access?

Security defaults are free and require MFA for everyone and block legacy authentication. If you have Entra ID P1 or P2, Conditional Access gives you finer control. You can’t use both at once.

What is report-only mode?

The policy is evaluated at every sign-in and the result is logged, but nothing is enforced. It shows exactly who would have been blocked or prompted before you switch it on.

What is phishing-resistant MFA?

Sign-in methods bound to the real website, such as FIDO2 security keys, passkeys and Windows Hello for Business, which can’t be relayed by phishing proxies the way app approvals and codes can.

Last updated 4 Dec 2026 · More in Microsoft 365 & Endpoint

More Microsoft 365 & Endpoint tools

See all →
Your product here. Reach IT engineers and architects who use these tools.Advertise →