Set Up Break Glass Accounts in Entra ID: A Step-by-Step Guide
Summary
A break glass account is a cloud-only Global Administrator account kept for the day normal administrator sign-ins fail. To set one up in Microsoft Entra ID, create two or more such accounts on the onmicrosoft.com domain, protect them with passkeys, exclude them from blocking Conditional Access policies, alert on every use and test them at least every 90 days.
Quick steps
- Run the read-only audit script against any emergency access accounts you already have.
- Create two or more cloud-only users on your
*.onmicrosoft.comdomain, give each a permanent active Global Administrator assignment and add them to a role-assignable security group. - Register a passkey (FIDO2) on a security key for each account, bootstrapped with a one-time Temporary Access Pass.
- Exclude that group from every Conditional Access policy that blocks or restricts sign-in.
- Store the security keys in separate safes and keep a named list of who may use them.
- Alert on every sign-in and every change to the accounts, the group and the policies.
- Run a drill at least every 90 days and after staff changes.
Applies to: Microsoft Entra ID, as of November 2026; the mandatory MFA enforcement it describes applies in the public Azure cloud. Conditional Access and the sign-in activity used by the scripts need Microsoft Entra ID P1 or P2. The scripts use the Microsoft Graph PowerShell v1.0 cmdlets and run in Windows PowerShell 5.1.
What is a break glass account in Entra ID, and why does it matter?
A break glass account is an administrator account reserved for emergencies, used only when no normal administrator account can sign in. Microsoft calls it an emergency access account; its guidance on emergency access accounts uses the two names for the same thing, a Global Administrator kept for "break glass" scenarios. A break glass account in Azure is the same object, because Azure subscriptions sit in the same Microsoft Entra tenant. A Global Administrator has no Azure resource access by default, but can elevate access to manage every subscription, which the Global Administrator elevate access rules watch.
Microsoft's examples include:
- Federation is down, so federated administrators can't sign in when Microsoft Entra ID redirects them to their identity provider.
- The MFA service, or every registered device of the administrators, is unavailable.
- The last person with Global Administrator access leaves, or their account is deleted or disabled on-premises.
- Every Global Administrator and Privileged Role Administrator assignment is eligible, activation needs approval and no approvers are left, so nobody can activate a role.
The same features make the account a target. A standing Global Administrator outside Conditional Access is a prize, and using such an account is MITRE ATT&CK T1078.004, Valid Accounts: Cloud Accounts. Adding an exclusion to a policy can fall under T1556.009, Modify Authentication Process: Conditional Access Policies. So you need an account that always works, a credential an attacker can't phish and an alert on every use.
What does Microsoft require of emergency access accounts?
| Requirement | Microsoft's guidance |
|---|---|
| How many | Two or more accounts, for redundancy |
| Identity source | Cloud-only, on the *.onmicrosoft.com domain, not federated or synchronized from on-premises |
| Role | Global Administrator; in Privileged Identity Management, a permanent active assignment, not eligible |
| Authentication | Passkey (FIDO2) recommended, or certificate-based authentication if you already run a PKI; different from your normal admin accounts' methods |
| Conditional Access | Excluded from policies that block or restrict sign-in; report-only policies don't need the exclusion |
| Credentials | Not tied to one person or to employee devices; stored in secure, fireproof safes in separate locations; no expiry and no automated cleanup |
| Use | From a designated secure workstation, such as a Privileged Access Workstation |
| Monitoring and testing | An alert on every sign-in and audit event; validation at least every 90 days |
Microsoft also allows a variant: individual emergency access accounts for each administrator, which adds accountability and remote use. The rest of this guide assumes shared accounts held by the team.
Before you start
Plan the accounts, the hardware and the roles before you create anything. Test the whole sequence in a lab tenant first, because a misconfigured Conditional Access policy can lock out every administrator.
Roles and licenses you need
| Task | Least privileged role in Microsoft's articles |
|---|---|
| Create the users | User Administrator |
| Assign Global Administrator, create the role-assignable group, change its members | Privileged Role Administrator |
| Configure passkey profiles and the Temporary Access Pass policy | Authentication Policy Administrator |
| Create a Temporary Access Pass for an administrator | Privileged Authentication Administrator |
| Add Conditional Access exclusions | Conditional Access Administrator (Security Administrator also works through Microsoft Graph) |
| Send sign-in and audit logs to Log Analytics | Security Administrator |
| Create the Azure Monitor alert rule | Monitoring Contributor (Azure role) |
| Run the read-only scripts | Global Reader |
Conditional Access needs Microsoft Entra ID P1 or P2, and role-assignable groups need P1. Passkeys work in every edition, Free included.
Prepare the hardware and the change window
- Buy FIDO2 security keys that meet Microsoft Entra ID's attestation requirements, enough for each account plus spares, and two safes in separate locations.
- Pick an admin workstation for the setup and the drills, ideally the Privileged Access Workstation the accounts will be used from.
- Route the user sign-in logs, the non-interactive user sign-in logs and the audit logs to a Log Analytics workspace under Entra ID > Monitoring & health > Diagnostic settings.
- Tell the security operations team before you start, because the setup writes audit events that look like an attack, such as a Temporary Access Pass for a Global Administrator.
Step 1: Audit your existing emergency access accounts
If your tenant already has emergency access accounts, check them against Microsoft's current guidance, because accounts set up under older guidance may rely on a password alone. The script below reads each account's sign-in activity, its role assignments and the types of authentication methods registered to it, and lists every gap. It's read-only and reports method types only, not their details.
Run it on an admin workstation as Global Reader. Reading signInActivity needs AuditLog.Read.All and a Microsoft Entra ID P1 or P2 license, and reading another user's authentication methods needs UserAuthenticationMethod.Read.All:
Connect-MgGraph -Scopes 'User.Read.All', 'AuditLog.Read.All', 'RoleManagement.Read.Directory', 'UserAuthenticationMethod.Read.All'
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication, Microsoft.Graph.Users, Microsoft.Graph.Identity.Governance, Microsoft.Graph.Identity.SignIns
<#
.SYNOPSIS
Read-only check of Microsoft Entra emergency access (break glass) accounts.
.DESCRIPTION
For each account object ID, reads the user object and its sign-in activity, the account's
active and eligible tenant-wide Microsoft Entra role assignments (direct and through groups)
and the types of authentication methods registered to it. Returns one row per account and
lists every departure from Microsoft's emergency access guidance in the Findings column:
- the user principal name isn't on an onmicrosoft.com domain
- the account is synchronized from on-premises Active Directory, or it's disabled
- Global Administrator isn't a direct, permanent active assignment
- no passkey (FIDO2) is registered (expected only if the account uses certificate-based
authentication instead)
- a phone, Microsoft Authenticator or email method is registered
- no successful sign-in within MaxDaysSinceSignIn days, so no drill ran in that window
It reports authentication method types only, never method details such as phone numbers.
Writes one CSV file and returns the rows. It changes nothing.
.PARAMETER UserId
Object IDs of the emergency access accounts, for example '00000000-0000-0000-0000-000000000000'.
.PARAMETER OutputPath
Path of the CSV report, for example 'C:\Reports\BreakGlass\breakglass-accounts.csv'.
.PARAMETER MaxDaysSinceSignIn
Days without a successful sign-in before an account is flagged. Default 90, the longest
validation interval in Microsoft's emergency access guidance.
.EXAMPLE
.\Get-EntraBreakGlassAccountAudit.ps1 -UserId '00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111' -OutputPath 'C:\Reports\BreakGlass\breakglass-accounts.csv'
.NOTES
Read-only. Makes no change in Microsoft Entra ID. Writes only the CSV report.
Run it in a session opened with delegated permissions:
Connect-MgGraph -Scopes 'User.Read.All','AuditLog.Read.All','RoleManagement.Read.Directory','UserAuthenticationMethod.Read.All'
as a Global Reader. Reading signInActivity requires a Microsoft Entra ID P1 or P2 license.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidatePattern('^[0-9a-fA-F-]{36}$')]
[string[]]$UserId,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$OutputPath,
[ValidateRange(1, 365)]
[int]$MaxDaysSinceSignIn = 90
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($null -eq (Get-MgContext)) {
throw 'No Microsoft Graph session. Run Connect-MgGraph first.'
}
$reportFolder = Split-Path -Path $OutputPath -Parent
if ($reportFolder -and -not (Test-Path -Path $reportFolder -PathType Container)) {
throw "Report folder not found: $reportFolder"
}
function Get-ODataType {
param($InputObject)
$extra = $InputObject.AdditionalProperties
if ($null -ne $extra -and $extra.ContainsKey('@odata.type')) {
return ([string]$extra['@odata.type']) -replace '^#microsoft\.graph\.', ''
}
return ''
}
# 1. Role names and the tenant-wide active and eligible assignment instances
$roleNames = @{}
foreach ($definition in @(Get-MgRoleManagementDirectoryRoleDefinition -All -Property 'id', 'displayName')) {
$roleNames[$definition.Id] = $definition.DisplayName
}
$globalAdminId = @($roleNames.Keys | Where-Object { $roleNames[$_] -eq 'Global Administrator' })
if ($globalAdminId.Count -ne 1) { throw 'Global Administrator role definition not found.' }
$globalAdminId = $globalAdminId[0]
$active = @(Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All | Where-Object { $_.DirectoryScopeId -eq '/' })
$eligible = @(Get-MgRoleManagementDirectoryRoleEligibilityScheduleInstance -All | Where-Object { $_.DirectoryScopeId -eq '/' })
$now = (Get-Date).ToUniversalTime()
$rows = @(foreach ($id in $UserId) {
# 2. The user object; signInActivity is returned only when it is named in $select
$user = @(Get-MgUser -Filter "id eq '$id'" -Property 'id', 'displayName', 'userPrincipalName', 'accountEnabled', 'onPremisesSyncEnabled', 'createdDateTime', 'signInActivity')
if ($user.Count -ne 1) {
Write-Warning "User not found: $id"
continue
}
$user = $user[0]
# 3. Groups the account belongs to, directly or through nesting
$groupIds = @(Get-MgUserTransitiveMemberOf -UserId $id -All |
Where-Object { (Get-ODataType -InputObject $_) -eq 'group' } | ForEach-Object { $_.Id })
$principalIds = @($id) + $groupIds
# 4. Global Administrator state
$gaActive = @($active | Where-Object { $_.RoleDefinitionId -eq $globalAdminId -and $principalIds -contains $_.PrincipalId })
$gaEligible = @($eligible | Where-Object { $_.RoleDefinitionId -eq $globalAdminId -and $principalIds -contains $_.PrincipalId })
$gaState = 'None'
if (@($gaActive | Where-Object { $_.PrincipalId -eq $id -and $_.AssignmentType -eq 'Assigned' -and $null -eq $_.EndDateTime }).Count -gt 0) { $gaState = 'PermanentActive' }
elseif (@($gaActive | Where-Object { $_.AssignmentType -eq 'Assigned' -and $null -eq $_.EndDateTime }).Count -gt 0) { $gaState = 'PermanentActiveThroughGroup' }
elseif (@($gaActive | Where-Object { $_.AssignmentType -eq 'Assigned' }).Count -gt 0) { $gaState = 'TimeBoundActive' }
elseif ($gaEligible.Count -gt 0) { $gaState = 'Eligible' }
$otherRoles = @($active | Where-Object { $_.RoleDefinitionId -ne $globalAdminId -and $principalIds -contains $_.PrincipalId } |
ForEach-Object { $roleNames[$_.RoleDefinitionId] } | Sort-Object -Unique)
# 5. Authentication method types only, no method details
$methodTypes = @(Get-MgUserAuthenticationMethod -UserId $id -All |
ForEach-Object { (Get-ODataType -InputObject $_) -replace 'AuthenticationMethod$', '' } | Sort-Object -Unique)
# 6. Last sign-in
$lastSuccess = $null
$lastAttempt = $null
if ($null -ne $user.SignInActivity) {
$lastSuccess = $user.SignInActivity.LastSuccessfulSignInDateTime
$lastAttempt = $user.SignInActivity.LastSignInDateTime
}
$findings = New-Object System.Collections.Generic.List[string]
if ($user.UserPrincipalName -notmatch '\.onmicrosoft\.com$') { $findings.Add('UPN not on an onmicrosoft.com domain') }
if ($user.OnPremisesSyncEnabled -eq $true) { $findings.Add('Synchronized from on-premises') }
if ($user.AccountEnabled -ne $true) { $findings.Add('Account disabled') }
if ($gaState -ne 'PermanentActive') { $findings.Add("Global Administrator is $gaState") }
if ($methodTypes -notcontains 'fido2') { $findings.Add('No passkey (FIDO2) registered') }
$personal = @($methodTypes | Where-Object { @('phone', 'microsoftAuthenticator', 'email') -contains $_ })
if ($personal.Count -gt 0) { $findings.Add("Review methods: $($personal -join ', ')") }
if ($null -eq $lastSuccess) { $findings.Add('No successful sign-in recorded') }
elseif (($now - $lastSuccess.ToUniversalTime()).TotalDays -gt $MaxDaysSinceSignIn) { $findings.Add("No successful sign-in in $MaxDaysSinceSignIn days") }
[pscustomobject]@{
UserPrincipalName = $user.UserPrincipalName
UserId = $user.Id
AccountEnabled = $user.AccountEnabled
CloudOnly = ($user.OnPremisesSyncEnabled -ne $true)
GlobalAdministrator = $gaState
OtherActiveRoles = ($otherRoles -join '; ')
MethodTypes = ($methodTypes -join ', ')
LastSuccessfulSignInUtc = $lastSuccess
LastSignInAttemptUtc = $lastAttempt
CreatedUtc = $user.CreatedDateTime
Findings = ($findings -join '; ')
}
})
$rows | Export-Csv -Path $OutputPath -NoTypeInformation -Encoding UTF8
$rows
Run it with the object IDs of your current emergency access accounts:
.\Get-EntraBreakGlassAccountAudit.ps1 -UserId '00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111' -OutputPath 'C:\Reports\BreakGlass\breakglass-accounts.csv'
Example output (the values are illustrative):
UserPrincipalName : bg-admin01@corp.example.com
UserId : 00000000-0000-0000-0000-000000000000
AccountEnabled : True
CloudOnly : False
GlobalAdministrator : Eligible
OtherActiveRoles :
MethodTypes : microsoftAuthenticator, password, phone
LastSuccessfulSignInUtc : 3/2/2026 9:14:07 AM
LastSignInAttemptUtc : 3/2/2026 9:14:07 AM
CreatedUtc : 6/11/2021 2:40:51 PM
Findings : UPN not on an onmicrosoft.com domain; Synchronized from on-premises; Global Administrator is Eligible; No passkey (FIDO2) registered; Review methods: microsoftAuthenticator, phone; No successful sign-in in 90 days
UserPrincipalName : bg-admin02@<tenant>.onmicrosoft.com
UserId : 11111111-1111-1111-1111-111111111111
AccountEnabled : True
CloudOnly : True
GlobalAdministrator : PermanentActive
OtherActiveRoles :
MethodTypes : fido2, password
LastSuccessfulSignInUtc : 10/20/2026 4:02:33 PM
LastSignInAttemptUtc : 10/20/2026 4:02:33 PM
CreatedUtc : 1/15/2025 11:27:09 AM
Findings :
How to read the results:
- UPN or synchronization findings: the account depends on your domain or on-premises directory, the very systems that might be down. Replace it with a new cloud-only account (Step 2).
- Global Administrator is Eligible or TimeBoundActive: the account needs PIM activation, or may lose the role, during the outage it exists for. Make the assignment permanent active.
- Review methods: Microsoft says the accounts mustn't have MFA or self-service password reset registered to an individual's device or personal details. A phone or Microsoft Authenticator entry points to a phone; find out whose.
- No successful sign-in in 90 days: nobody has tested the account within Microsoft's validation interval. Run the drill in Step 7.
lastSuccessfulSignInDateTime wasn't backfilled before December 1, 2023, and the last sign-in value can take up to 24 hours to update.
Step 2: Create two cloud-only emergency access accounts
Create the accounts on the initial *.onmicrosoft.com domain so they don't depend on a custom domain, federation or synchronization.
- Sign in to the Microsoft Entra admin center as at least a User Administrator.
- Browse to Entra ID > Users, then select New user > Create new user.
- For User principal name, enter a name and pick the
<tenant>.onmicrosoft.comdomain. Leave Account enabled selected. - Select Review + create. Repeat for the second account, and record both object IDs.
Microsoft's pages disagree on naming: its Zero Trust deployment guidance avoids obvious names such as "break glass", while the Microsoft cloud security benchmark recommends descriptive ones. Alerts key on object IDs, so pick a name that identifies no person. The same Zero Trust guidance says to give the account a long, strong password stored offline; it then signs in with the passkey from Step 3.
Give each account a permanent active Global Administrator assignment
Microsoft's guidance makes the Global Administrator assignment of emergency access accounts active permanent rather than eligible. If you use PIM, browse to ID Governance > Privileged Identity Management > Microsoft Entra roles > Roles > Add assignments, select Global Administrator and the account, and choose Active with no end date. We recommend a direct assignment rather than one through a group, so the role doesn't depend on who controls a group. Our Microsoft Entra PIM guide explains why we recommend allowing permanent active assignments in the Global Administrator role settings.
The same request in Microsoft Graph PowerShell, as a Privileged Role Administrator, previewed with -WhatIf:
Connect-MgGraph -Scopes 'RoleManagement.ReadWrite.Directory'
$role = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Global Administrator'"
$assignment = @{
Action = 'adminAssign'
Justification = 'Emergency access account, change CHG-1234'
RoleDefinitionId = $role.Id
DirectoryScopeId = '/'
PrincipalId = '00000000-0000-0000-0000-000000000000'
ScheduleInfo = @{
StartDateTime = (Get-Date).ToUniversalTime()
Expiration = @{ Type = 'noExpiration' }
}
}
New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -BodyParameter $assignment -WhatIf
Drop -WhatIf to send the request. Microsoft's API reference says role settings limit the expiration you can request, for example by rejecting noExpiration, so check the Global Administrator role settings first. The assignment appears in the audit log as a role assignment activity, which the privileged directory role assignment rules watch.
Put the accounts in a role-assignable group
Microsoft recommends a dedicated security group, such as EmergencyAccess, which you'll reuse for the passkey profile, the Temporary Access Pass policy and the Conditional Access exclusion. Anyone who can add a member to it can take an account out of Conditional Access. In an ordinary security group, group owners, Directory Writers, Groups Administrators, Identity Governance Administrators, User Administrators and Intune Administrators can add members. In a role-assignable group, the least privileged role that can is Privileged Role Administrator, alongside group owners, and the Group.ReadWrite.All permission isn't enough.
So we recommend creating the group as role-assignable, even though you assign it no role. Role-assignable groups come with rules: the property is set only at creation, membership must be assigned rather than dynamic, groups can't be nested in them, and a tenant holds at most 500. Creating one takes at least Privileged Role Administrator and a Microsoft Entra ID P1 license. Preview the group and its two members:
Connect-MgGraph -Scopes 'Group.ReadWrite.All', 'GroupMember.ReadWrite.All', 'RoleManagement.ReadWrite.Directory'
New-MgGroup -DisplayName 'EmergencyAccess' -Description 'Emergency access accounts excluded from Conditional Access' -MailEnabled:$false -MailNickname 'EmergencyAccess' -SecurityEnabled -IsAssignableToRole -WhatIf
New-MgGroupMemberByRef -GroupId '22222222-2222-2222-2222-222222222222' -OdataId 'https://graph.microsoft.com/v1.0/directoryObjects/00000000-0000-0000-0000-000000000000' -WhatIf
New-MgGroupMemberByRef -GroupId '22222222-2222-2222-2222-222222222222' -OdataId 'https://graph.microsoft.com/v1.0/directoryObjects/11111111-1111-1111-1111-111111111111' -WhatIf
Run New-MgGroup without -WhatIf first, then replace the placeholder group ID in the member commands with the new group's ID.
Step 3: Register a passkey on a security key for each account
Use a phishing-resistant method that your everyday administrators don't use. Microsoft recommends passkeys (FIDO2), or certificate-based authentication if you already have a PKI. A passkey on a FIDO2 security key is device-bound: the private key never leaves the key.
How does mandatory MFA affect break glass accounts?
Mandatory MFA means a break glass account can no longer rely on a password alone in Microsoft's admin portals. As of November 2026, Microsoft's mandatory MFA article describes two enforcement phases in the public Azure cloud:
| Phase | Applications | Enforcement start |
|---|---|---|
| Phase 1 | Azure portal, Microsoft Entra admin center, Microsoft Intune admin center: MFA for any create, read, update or delete operation | October 2024, gradual rollout |
| Phase 1 | Microsoft 365 admin center | February 2025, gradual rollout |
| Phase 2 | Azure CLI, Azure PowerShell, Azure mobile app, infrastructure as code tools and the Azure Resource Manager REST API: MFA for create, update and delete operations | October 1, 2025, gradual rollout; tenants could postpone it until July 1, 2026 |
The article names break glass accounts explicitly: they must sign in with MFA once enforcement begins, with no exception, and a passkey or certificate-based authentication satisfies the requirement. A runbook that still describes a password-only account excluded from all MFA is out of date. That account may be prompted to set up MFA in the very portals an emergency needs.
Create a passkey profile for the emergency access accounts
Passkey profiles apply passkey rules to a group. Microsoft's example for highly privileged accounts allows only device-bound passkeys with attestation enforced, so Microsoft Entra ID can verify the key's make and model at registration.
- Sign in to the Microsoft Entra admin center as at least an Authentication Policy Administrator.
- Browse to Entra ID > Security > Authentication methods > Policies and select Passkey (FIDO2). Opt in to passkey profiles from the banner. You can't opt out afterward.
- On Configure, set Allow self-service set up to Yes.
- Select + Add passkey profile. Allow Device-bound passkeys only and set Enforce attestation to Yes. Optionally enforce key restrictions to the AAGUID of your security key model.
- On Enable and target, assign the profile to the emergency access group.
Bootstrap the registration with a Temporary Access Pass
A user must have completed MFA within the past five minutes before registering a passkey, and a new emergency access account has no MFA method yet. Microsoft's answer is a Temporary Access Pass, a time-limited passcode for onboarding passwordless methods.
- As an Authentication Policy Administrator, enable the Temporary Access Pass method under Authentication methods > Policies and include the emergency access group. Only users in the policy can sign in with a pass.
- As a Privileged Authentication Administrator, open each account under Entra ID > Users > Authentication methods > Add authentication method and create a one-time pass with a short lifetime. Authentication Administrators can't create one for admins.
- On the designated workstation, sign in to Security info with the pass, select Add sign-in method > Passkey, and choose Security key. Finish within 10 minutes when the pass is single-use.
- Register a second key per account if you keep a spare, then delete the Temporary Access Pass from the account's authentication methods.
Microsoft's security operations guide rates a Temporary Access Pass for a privileged account as high severity. The audit log records it as an Admin registered security info activity, which the Temporary Access Pass rules watch. For the new key, Microsoft's audit activity reference lists User registered security info under Authentication Methods and Add Passkey (device-bound) under the Device Registration Service. Outside the setup, alert on all of these.
Step 4: Exclude the accounts from Conditional Access
Exclude the emergency access group, not the individual accounts, from every Conditional Access policy that blocks or restricts sign-in. Microsoft's reasoning: the passkey protects the account, and an enforced policy that requires MFA, a compliant device or another control could make it unusable in the exact emergency it exists for. Report-only policies don't block access, so they don't need the exclusion.
Find the policies that don't exclude the accounts (read-only)
This script reports each Conditional Access policy whose user assignments include an emergency access account, through All users, the account, a group or a role. It's read-only and evaluates user assignments only, so confirm its results with the What If tool. Run it as Global Reader after Connect-MgGraph -Scopes 'Policy.Read.All','User.Read.All','RoleManagement.Read.Directory'.
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication, Microsoft.Graph.Users, Microsoft.Graph.Identity.Governance, Microsoft.Graph.Identity.SignIns
<#
.SYNOPSIS
Read-only list of the Conditional Access policies that include an emergency access account.
.DESCRIPTION
Reads every Conditional Access policy and, for each emergency access account, works out from
the policy's user assignments whether the policy includes the account and whether it excludes
it. A policy includes or excludes an account through All users, the account's object ID, a
group the account belongs to (directly or through nesting), or a Microsoft Entra role the
account holds as an active tenant-wide assignment.
Each row is one policy that includes one account, with the policy state, its grant and session
controls and a finding:
Not excluded an enabled policy applies to the account
Report-only the policy only logs; add the exclusion before anyone turns it on
Disabled the policy is off
Excluded the account is excluded (the ExcludedBy column says how)
The script evaluates user assignments only. Target resources, platforms, locations, client
apps and risk conditions can still keep a policy from applying, so confirm the result with
the Conditional Access What If tool. Writes one CSV file and returns the rows that aren't
excluded. It changes nothing.
.PARAMETER UserId
Object IDs of the emergency access accounts, for example '00000000-0000-0000-0000-000000000000'.
.PARAMETER OutputPath
Path of the CSV report, for example 'C:\Reports\BreakGlass\ca-coverage.csv'.
.EXAMPLE
.\Get-EntraBreakGlassCaCoverage.ps1 -UserId '00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111' -OutputPath 'C:\Reports\BreakGlass\ca-coverage.csv'
.NOTES
Read-only. Makes no change in Microsoft Entra ID. Writes only the CSV report.
Run it in a session opened with delegated permissions:
Connect-MgGraph -Scopes 'Policy.Read.All','User.Read.All','RoleManagement.Read.Directory'
as a Global Reader.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidatePattern('^[0-9a-fA-F-]{36}$')]
[string[]]$UserId,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$OutputPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($null -eq (Get-MgContext)) {
throw 'No Microsoft Graph session. Run Connect-MgGraph first.'
}
$reportFolder = Split-Path -Path $OutputPath -Parent
if ($reportFolder -and -not (Test-Path -Path $reportFolder -PathType Container)) {
throw "Report folder not found: $reportFolder"
}
function Test-Overlap {
param([object[]]$Left, [object[]]$Right)
return @($Left | Where-Object { $null -ne $_ -and $Right -contains $_ }).Count -gt 0
}
# 1. Role definitions: match the policy's role IDs on both the definition ID and the template ID
$roleIds = @{}
foreach ($definition in @(Get-MgRoleManagementDirectoryRoleDefinition -All -Property 'id', 'templateId')) {
$roleIds[$definition.Id] = @($definition.Id, $definition.TemplateId) | Where-Object { $_ } | Sort-Object -Unique
}
$active = @(Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All | Where-Object { $_.DirectoryScopeId -eq '/' })
# 2. Each account with its groups and active roles
$accounts = @(foreach ($id in $UserId) {
$user = Get-MgUser -UserId $id -Property 'id', 'userPrincipalName'
$groupIds = @(Get-MgUserTransitiveMemberOf -UserId $id -All | Where-Object {
$extra = $_.AdditionalProperties
$null -ne $extra -and $extra.ContainsKey('@odata.type') -and $extra['@odata.type'] -eq '#microsoft.graph.group'
} | ForEach-Object { $_.Id })
$principalIds = @($id) + $groupIds
$accountRoles = @($active | Where-Object { $principalIds -contains $_.PrincipalId } |
ForEach-Object { $roleIds[$_.RoleDefinitionId] } | Sort-Object -Unique)
[pscustomobject]@{ Id = $id; Upn = $user.UserPrincipalName; Groups = $groupIds; Roles = $accountRoles }
})
# 3. Every policy against every account
$policies = @(Get-MgIdentityConditionalAccessPolicy -All)
$rows = New-Object System.Collections.Generic.List[object]
foreach ($policy in $policies) {
$users = $null
if ($null -ne $policy.Conditions) { $users = $policy.Conditions.Users }
if ($null -eq $users) { continue }
$grant = @()
if ($null -ne $policy.GrantControls) {
$grant += @($policy.GrantControls.BuiltInControls | Where-Object { $_ })
if ($null -ne $policy.GrantControls.AuthenticationStrength -and $policy.GrantControls.AuthenticationStrength.DisplayName) {
$grant += "authenticationStrength: $($policy.GrantControls.AuthenticationStrength.DisplayName)"
}
}
$session = @()
if ($null -ne $policy.SessionControls) {
if ($null -ne $policy.SessionControls.SignInFrequency -and $policy.SessionControls.SignInFrequency.IsEnabled -eq $true) { $session += 'signInFrequency' }
if ($null -ne $policy.SessionControls.PersistentBrowser -and $policy.SessionControls.PersistentBrowser.IsEnabled -eq $true) { $session += 'persistentBrowser' }
}
foreach ($account in $accounts) {
$includeUsers = @($users.IncludeUsers)
$included = ($includeUsers -contains 'All') -or ($includeUsers -contains $account.Id) -or
(Test-Overlap -Left @($users.IncludeGroups) -Right $account.Groups) -or
(Test-Overlap -Left @($users.IncludeRoles) -Right $account.Roles)
if (-not $included) { continue }
$excludedBy = @()
if (@($users.ExcludeUsers) -contains $account.Id) { $excludedBy += 'User' }
if (Test-Overlap -Left @($users.ExcludeGroups) -Right $account.Groups) { $excludedBy += 'Group' }
if (Test-Overlap -Left @($users.ExcludeRoles) -Right $account.Roles) { $excludedBy += 'Role' }
switch ($policy.State) {
'disabled' { $finding = 'Disabled' }
'enabledForReportingButNotEnforced' { $finding = if ($excludedBy.Count -gt 0) { 'Excluded' } else { 'Report-only' } }
default { $finding = if ($excludedBy.Count -gt 0) { 'Excluded' } else { 'Not excluded' } }
}
$rows.Add([pscustomobject]@{
PolicyName = $policy.DisplayName
PolicyId = $policy.Id
State = $policy.State
Account = $account.Upn
Finding = $finding
ExcludedBy = ($excludedBy -join ', ')
GrantControls = ($grant -join ', ')
SessionControl = ($session -join ', ')
})
}
}
$rows | Export-Csv -Path $OutputPath -NoTypeInformation -Encoding UTF8
$rows | Where-Object { $_.Finding -ne 'Excluded' } | Sort-Object Finding, PolicyName
.\Get-EntraBreakGlassCaCoverage.ps1 -UserId '00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111' -OutputPath 'C:\Reports\BreakGlass\ca-coverage.csv' | Format-Table PolicyName, State, Account, Finding, GrantControls
Example output (the values are illustrative):
PolicyName State Account Finding GrantControls
---------- ----- ------- ------- -------------
Block legacy authentication enabled bg-admin01@<tenant>.onmicrosoft.com Not excluded block
Require compliant device for admins enabled bg-admin01@<tenant>.onmicrosoft.com Not excluded compliantDevice
Require compliant device for admins enabled bg-admin02@<tenant>.onmicrosoft.com Not excluded compliantDevice
Block high-risk sign-ins enabledForReportingButNotEnforced bg-admin02@<tenant>.onmicrosoft.com Report-only block
Every Not excluded row is a policy that could stop the account in an emergency. The Report-only rows matter because Microsoft-managed policies arrive in report-only state, and Microsoft turns them on if you leave them there: normally no less than 30 days after they arrive, sooner in some cases. You can exclude identities from those policies but can't rename or delete them.
Add the exclusion (changes configuration)
In the portal, sign in as at least a Conditional Access Administrator and browse to Entra ID > Conditional Access > Policies. Open each policy, select Users or workload identities, then Exclude > Users and groups, choose the emergency access group and save. Microsoft's security operations guide rates accounts exempt from Conditional Access as a high-severity item to monitor, so review this exclusion list at every drill.
The script below makes the same change through Microsoft Graph, with -WhatIf and -Confirm support. It backs up each policy's excluded groups to JSON, then sends only conditions.users.excludeGroups; Microsoft's Graph reference for policy updates says properties you leave out keep their values or are recalculated. Run it as a Conditional Access Administrator or Security Administrator after Connect-MgGraph -Scopes 'Policy.Read.All','Policy.ReadWrite.ConditionalAccess','Group.Read.All'.
#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication, Microsoft.Graph.Groups, Microsoft.Graph.Identity.SignIns
<#
.SYNOPSIS
Adds the emergency access group to the excluded groups of Conditional Access policies.
.DESCRIPTION
Checks that ExclusionGroupId is a security group and warns if it isn't role-assignable. Then,
for each enabled Conditional Access policy that has user assignments (and, with
IncludeReportOnly, each report-only policy), it adds the group to the policy's excluded groups
unless the group is already there. Disabled policies and policies without user assignments,
such as policies for workload identities, are skipped.
Before any change, it writes the current excluded groups of every policy it will touch to a
JSON backup. Each update sends only conditions.users.excludeGroups through
Update-MgIdentityConditionalAccessPolicy. Run it with -WhatIf first. Each policy update asks
for confirmation unless you pass -Confirm:$false.
.PARAMETER ExclusionGroupId
Object ID of the emergency access group, for example '22222222-2222-2222-2222-222222222222'.
.PARAMETER BackupPath
Path of the JSON backup, for example 'C:\Reports\BreakGlass\ca-exclusion-backup.json'.
.PARAMETER PolicyId
Optional. Limit the change to these policy IDs.
.PARAMETER IncludeReportOnly
Also add the exclusion to report-only policies, for example Microsoft-managed policies that
Microsoft turns on later.
.EXAMPLE
.\Add-EntraBreakGlassCaExclusion.ps1 -ExclusionGroupId '22222222-2222-2222-2222-222222222222' -BackupPath 'C:\Reports\BreakGlass\ca-exclusion-backup.json' -IncludeReportOnly -WhatIf
.NOTES
Changes configuration. Updates Conditional Access policies in Microsoft Entra ID.
Run it in a session opened with delegated permissions:
Connect-MgGraph -Scopes 'Policy.Read.All','Policy.ReadWrite.ConditionalAccess','Group.Read.All'
as a Conditional Access Administrator or Security Administrator.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory = $true)]
[ValidatePattern('^[0-9a-fA-F-]{36}$')]
[string]$ExclusionGroupId,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$BackupPath,
[ValidatePattern('^[0-9a-fA-F-]{36}$')]
[string[]]$PolicyId = @(),
[switch]$IncludeReportOnly
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($null -eq (Get-MgContext)) {
throw 'No Microsoft Graph session. Run Connect-MgGraph first.'
}
$backupFolder = Split-Path -Path $BackupPath -Parent
if ($backupFolder -and -not (Test-Path -Path $backupFolder -PathType Container)) {
throw "Backup folder not found: $backupFolder"
}
# 1. The exclusion group must exist and be a security group
$group = Get-MgGroup -GroupId $ExclusionGroupId -Property 'id', 'displayName', 'securityEnabled', 'isAssignableToRole'
if ($group.SecurityEnabled -ne $true) { throw "$($group.DisplayName) isn't a security group." }
if ($group.IsAssignableToRole -ne $true) {
Write-Warning "$($group.DisplayName) isn't role-assignable, so roles such as Groups Administrator and User Administrator can change its members."
}
# 2. Policies to change
$states = @('enabled')
if ($IncludeReportOnly) { $states += 'enabledForReportingButNotEnforced' }
$policies = @(Get-MgIdentityConditionalAccessPolicy -All)
if ($PolicyId.Count -gt 0) {
$missing = @($PolicyId | Where-Object { @($policies.Id) -notcontains $_ })
if ($missing.Count -gt 0) { throw "Policy not found: $($missing -join ', ')" }
$policies = @($policies | Where-Object { $PolicyId -contains $_.Id })
}
$targets = @(foreach ($policy in $policies) {
if ($states -notcontains $policy.State) { continue }
if ($null -eq $policy.Conditions -or $null -eq $policy.Conditions.Users) {
Write-Warning "$($policy.DisplayName) has no user assignments; skipped."
continue
}
$current = @($policy.Conditions.Users.ExcludeGroups | Where-Object { $_ })
if ($current -contains $ExclusionGroupId) { continue }
[pscustomobject]@{ Policy = $policy; Current = $current }
})
if ($targets.Count -eq 0) {
Write-Output "Every selected policy already excludes $($group.DisplayName)."
return
}
# 3. Backup of the current excluded groups, written even under -WhatIf
$backup = @($targets | ForEach-Object {
[pscustomobject]@{
PolicyId = $_.Policy.Id
DisplayName = $_.Policy.DisplayName
State = $_.Policy.State
ExcludeGroups = @($_.Current)
}
})
ConvertTo-Json -InputObject $backup -Depth 5 | Set-Content -Path $BackupPath -Encoding UTF8 -WhatIf:$false
# 4. Add the group, one policy at a time
foreach ($target in $targets) {
$policy = $target.Policy
if ($PSCmdlet.ShouldProcess("$($policy.DisplayName) ($($policy.Id))", "Add $($group.DisplayName) to the excluded groups")) {
$body = @{ conditions = @{ users = @{ excludeGroups = @($target.Current) + $ExclusionGroupId } } }
try {
Update-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $policy.Id -BodyParameter $body -Confirm:$false
[pscustomobject]@{ Policy = $policy.DisplayName; State = $policy.State; Status = 'Updated' }
}
catch {
Write-Warning "$($policy.DisplayName): $($_.Exception.Message)"
[pscustomobject]@{ Policy = $policy.DisplayName; State = $policy.State; Status = 'Failed' }
}
}
}
Preview the change across enabled and report-only policies:
.\Add-EntraBreakGlassCaExclusion.ps1 -ExclusionGroupId '22222222-2222-2222-2222-222222222222' -BackupPath 'C:\Reports\BreakGlass\ca-exclusion-backup.json' -IncludeReportOnly -WhatIf
What if: Performing the operation "Add EmergencyAccess to the excluded groups" on target "Block legacy authentication (33333333-3333-3333-3333-333333333333)".
What if: Performing the operation "Add EmergencyAccess to the excluded groups" on target "Require compliant device for admins (44444444-4444-4444-4444-444444444444)".
What if: Performing the operation "Add EmergencyAccess to the excluded groups" on target "Block high-risk sign-ins (55555555-5555-5555-5555-555555555555)".
Run it again without -WhatIf to apply the change, then rerun the coverage script. Each update writes an Update Conditional Access policy record. Two more points from Microsoft's guidance:
- Microsoft's own policy guides, for example for blocking authentication flows as in our device code flow guide, and its risk-based managed policies tell you to exclude emergency access accounts too.
- Prepare contingency policies that you can turn on during an outage to restore access for critical users.
Step 5: Store the credentials and assign ownership
Microsoft's guidance separates the credential from any one person. Store it in a known, secure location that several members of the administration team can reach, and don't connect the accounts to employee-supplied devices such as phones.
- Security keys: keep them in secure, fireproof safes in separate locations, so one unreachable site doesn't take every key with it.
- Who may use them: keep a list of the authorized individuals and review it at every drill and staff change.
- Safe combinations: change them regularly and whenever someone with access leaves the organization.
- Where to use them: sign in only from a designated secure workstation, such as a Privileged Access Workstation.
- No expiry and no cleanup: the credential or device must not expire, and the accounts must stay out of automated cleanup of unused accounts; we'd also exclude them from access reviews of inactive privileged users.
- Separate from on-premises: keep emergency access for on-premises systems and for cloud services distinct, with no dependency of one on the other. Our hybrid identity hardening guide covers the synchronized side.
Name an owner for the runbook, the authorized-user list and the drill calendar. Microsoft's own wording asks that the break glass process be "documented and current".
Step 6: Alert on every sign-in and every change
Alert on any activity, because these accounts exist only for emergencies. Microsoft's security operations guide for privileged accounts asks for a high-priority alert every time an emergency access account is used or changed: a sign-in, a password change, a change of roles or permissions, or an authentication method added or changed.
Sign-in alert in Azure Monitor
Microsoft's own sample queries SigninLogs by UserId. The query below adds the non-interactive sign-ins and returns every attempt, successful or not, using columns from the SigninLogs table reference and the AADNonInteractiveUserSignInLogs reference.
// Every sign-in attempt by an emergency access account, interactive or non-interactive, successful or not.
// Needs the user sign-in logs and non-interactive user sign-in logs in the workspace (diagnostic setting).
// In an alert rule, the rule's lookback window sets the time range.
let BreakGlassIds = dynamic(["00000000-0000-0000-0000-000000000000", "11111111-1111-1111-1111-111111111111"]);
union SigninLogs, AADNonInteractiveUserSignInLogs
| where UserId in (BreakGlassIds)
| project TimeGenerated, Type, UserPrincipalName, UserId, AppDisplayName, IPAddress, ResultType, ResultDescription, ConditionalAccessStatus, AuthenticationRequirement
| order by TimeGenerated desc
To turn it into an alert, follow Microsoft's steps as at least a Monitoring Contributor:
- In the Azure portal, open Monitor > Alerts > + Create > Alert rule, and select your Log Analytics workspace as the scope.
- On Condition, choose Custom log search, set Query type to Aggregated logs and paste the query.
- Under Alert logic, set Threshold type to Static, Operator to Greater than and Threshold value to 0, then pick an evaluation frequency.
- On Actions, select an action group that sends email and SMS to the administrators.
- On Details, set Severity to 0 - Critical, select Enable upon creation, then Review + create.
Changes to the accounts, the group and the policies
The second query catches changes made to or by the accounts, and changes that name the emergency access group, such as a new member:
// Directory changes made to or by an emergency access account, and changes that name the exclusion group.
let BreakGlassIds = dynamic(["00000000-0000-0000-0000-000000000000", "11111111-1111-1111-1111-111111111111"]);
let ExclusionGroupId = "22222222-2222-2222-2222-222222222222";
AuditLogs
| where TimeGenerated > ago(30d)
| extend ActorId = tostring(InitiatedBy.user.id)
| extend Actor = coalesce(tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| extend TargetText = tostring(TargetResources)
| mv-apply Target = TargetResources on (summarize TargetIds = make_set(tostring(Target.id)), Targets = make_set(tostring(Target.displayName)))
| where ActorId in (BreakGlassIds)
or array_length(set_intersect(TargetIds, BreakGlassIds)) > 0
or TargetText contains ExclusionGroupId
| project TimeGenerated, OperationName, Result, Actor, Targets, CorrelationId
| order by TimeGenerated desc
The third query flags a Conditional Access policy that was deleted, or changed so that it no longer excludes the group. It compares the old and new policy JSON that Microsoft records under TargetResources > modifiedProperties:
// Conditional Access policies deleted, or changed so that the exclusion group is no longer excluded.
let ExclusionGroupId = "22222222-2222-2222-2222-222222222222";
AuditLogs
| where TimeGenerated > ago(30d)
| where OperationName in~ ("Update Conditional Access policy", "Delete Conditional Access policy")
| extend Actor = coalesce(tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| mv-expand Target = TargetResources
| extend OldValue = tostring(Target.modifiedProperties[0].oldValue), NewValue = tostring(Target.modifiedProperties[0].newValue)
| extend ExclusionRemoved = OldValue contains ExclusionGroupId and not(NewValue contains ExclusionGroupId)
| where OperationName =~ "Delete Conditional Access policy" or ExclusionRemoved
| project TimeGenerated, OperationName, Result, Actor, Policy = tostring(Target.displayName), ExclusionRemoved, CorrelationId
| order by TimeGenerated desc
| Activity | Why it matters | Related pages |
|---|---|---|
| Any sign-in by the accounts | Every use is a drill, a real emergency or misuse | Rules for sign-ins blocked by Conditional Access, high-risk sign-in rules |
| Reset password (by admin) | Someone changed the account's password | Administrator password reset rules |
| User registered security info, Admin registered security info | A new authentication method or a Temporary Access Pass | Rules for MFA methods registered by an attacker |
| User deleted security info, Admin deleted security info | A method was removed, possibly the passkey | Authentication method removal rules |
| Add member to role, Remove member from role | The accounts' roles changed | The privileged role assignment rules above |
| Add member to group, Remove member from group | Someone joined or left the emergency access group | The second query |
| Update Conditional Access policy, Delete Conditional Access policy | An exclusion or a whole policy changed | Rules for weakened or deleted Conditional Access policies |
The third query ignores case in activity names, so a capitalization difference doesn't hide a change. When an alert fires, preserve the logs and run a post-mortem: was the use a drill, a real emergency or misuse, and did the actions match the authorized purpose?
Step 7: Test the accounts every 90 days
Microsoft asks for regular drills, at least every 90 days, after IT staff changes such as a termination or a change of position, and when the tenant's Microsoft Entra subscriptions change. Its Conditional Access guidance gives quarterly testing against your current policies as an example. Each drill should:
- Notify the security monitoring staff that the check is under way.
- Review and update the list of people authorized to use the credentials.
- Confirm the runbook is documented and current, and that the people who'd act in an emergency are trained on it.
- Sign in with each account from the designated workstation, using the key from the safe, and perform an administrative task.
- Confirm that no MFA or self-service password reset method is registered to anyone's own device or personal details. The Step 1 script lists the method types.
- Confirm the sign-in alert fired and reached the right people.
- Change the safe combinations if the schedule or a departure calls for it, and record the drill.
Verify
Check the accounts, the policies and a real sign-in.
| Check | Expected result |
|---|---|
Get-EntraBreakGlassAccountAudit.ps1 |
Each account is cloud-only on *.onmicrosoft.com, holds PermanentActive, lists fido2 and no personal methods; Findings is empty after a drill |
Get-EntraBreakGlassCaCoverage.ps1 |
No Not excluded rows; Report-only rows only where you chose not to add the exclusion |
| Entra ID > Conditional Access > Policies > What If | For each account, with a target resource, device platform and client app set, no enforced policy that blocks or requires a control applies |
| Drill sign-in | The passkey satisfies the MFA prompt in the admin portals, and the alert fires |
| Sign-in record of the drill | ConditionalAccessStatus is notApplied, which Microsoft's sign-in log reference defines as no policy applied to the user and application during the sign-in |
The What If tool evaluates enabled and report-only policies and needs the identity, a target resource, a device platform and a client app. For the sign-in record, this read-only command lists the last day's sign-ins of one account. It needs AuditLog.Read.All, a role such as Global Reader or Reports Reader, and a Microsoft Entra ID P1 or P2 license:
Connect-MgGraph -Scopes 'AuditLog.Read.All'
$since = (Get-Date).ToUniversalTime().AddDays(-1).ToString('yyyy-MM-ddTHH:mm:ssZ')
Get-MgAuditLogSignIn -Filter "userId eq '00000000-0000-0000-0000-000000000000' and createdDateTime ge $since" -Top 10 |
Select-Object CreatedDateTime, AppDisplayName, IPAddress, ConditionalAccessStatus, @{ Name = 'ErrorCode'; Expression = { $_.Status.ErrorCode } }
Roll back
Most of these changes can be reversed in the portal; two can't.
| Change | How to roll back | Notes |
|---|---|---|
| Conditional Access exclusion | Remove the group under the policy's Exclude > Users and groups, or restore each policy's excluded groups from the JSON backup | Removing the exclusion brings back the lockout risk; do it only to correct a wrong group |
| Emergency access group | Delete it | A deleted role-assignable group is soft-deleted and can be restored within 30 days |
| Passkey profiles opt-in | Can't be undone | Microsoft says you can't opt out after opting in; you can delete a profile only after removing its targets |
| Registered passkey | Delete it from the account's Authentication methods | Register the replacement key first |
| Temporary Access Pass | Delete it from the account's Authentication methods | It also stops working when its lifetime ends |
| Global Administrator assignment | Remove the assignment in PIM or Roles & admins | PIM blocks removal of the last active Global Administrator assignment |
| Emergency access account | Delete the user | Restorable from Deleted users for 30 days; after that the deletion can't be undone |
To restore the excluded groups recorded by the change script, preview first:
Connect-MgGraph -Scopes 'Policy.Read.All', 'Policy.ReadWrite.ConditionalAccess'
$backup = Get-Content -Path 'C:\Reports\BreakGlass\ca-exclusion-backup.json' -Raw | ConvertFrom-Json
foreach ($entry in @($backup)) {
$body = @{ conditions = @{ users = @{ excludeGroups = @($entry.ExcludeGroups | Where-Object { $_ }) } } }
Update-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $entry.PolicyId -BodyParameter $body -WhatIf
}
Troubleshooting
Most problems come from the passkey bootstrap, a policy without the exclusion, or monitoring that was never wired up.
| Symptom | Cause | Fix |
|---|---|---|
| Passkey registration asks for MFA the new account doesn't have | A user must have completed MFA in the past five minutes to register a passkey | Sign in with a Temporary Access Pass created by a Privileged Authentication Administrator |
| The Temporary Access Pass is rejected at sign-in | Only users included in the Temporary Access Pass policy can sign in with one | Add the account or the emergency access group to the policy |
| Security info doesn't offer the passkey option | Allow self-service set up is No | Set it to Yes on the Passkey (FIDO2) Configure tab |
| The security key is refused at registration | Enforce attestation is on and the key doesn't meet Microsoft Entra ID's attestation requirements | Use a key model that supports attestation with Microsoft Entra ID |
| The admin portal asks a test account to set up MFA | Mandatory MFA applies and the account has no passkey or certificate | Register the passkey (Step 3) |
| A drill sign-in is blocked by Conditional Access | A new or Microsoft-managed policy includes the account without the exclusion | Run the coverage script and add the exclusion |
| Adding a member to the emergency access group fails in Microsoft Graph | Role-assignable group membership needs RoleManagement.ReadWrite.Directory; Group.ReadWrite.All doesn't work |
Add the scope and use a Privileged Role Administrator |
The Global Administrator request with noExpiration fails with 400 Bad Request |
The role's settings require active assignments to expire | Select Allow permanent active assignment in the Global Administrator role settings |
| The script shows no last sign-in | No sign-in yet, no backfill before December 1, 2023, an update delay of up to 24 hours, or no P1 or P2 license | Run a drill and check again the next day |
| The drill didn't raise an alert | Sign-in logs don't reach the workspace, or the rule's frequency hasn't come round | Check Diagnostic settings and the alert rule |
How Forestall helps
Forestall's CAP Audit shows the resultant Conditional Access protections per user in its User Summary, so you can confirm what applies to each emergency access account and spot other accounts that no enforced policy covers. Each Conditional Access policy page restates the policy in plain language and points out risks such as a missing break glass exclusion. The AZ_CAP_EXCLUDES edge records every exclusion, where break glass accounts are expected and unexpected exclusions are a finding. Identity Attack Surface Management maps these identities and their trust relationships across Active Directory, Entra ID and Azure without agents.
Frequently Asked Questions
What is a break glass account in Azure?
A break glass account in Azure is a cloud-only Microsoft Entra ID account with the Global Administrator role, kept for emergencies when normal administrators can't sign in, for example during a federation or MFA outage. Azure subscriptions sit in the same tenant, and a Global Administrator can elevate access to manage all of them. Microsoft recommends two or more such accounts, on the onmicrosoft.com domain, with a passkey or certificate-based authentication.
Is an emergency access account the same as a break glass account?
Yes, emergency access account is Microsoft's official name for a break glass account, and its guidance uses both terms for the same accounts and the scenarios they cover. Either name describes a highly privileged, cloud-only account that no single person owns, that's excluded from Conditional Access policies that block or restrict sign-in, and that's used only when every normal administrator account fails.
How do I create a break glass account in Azure?
Create a break glass account as a cloud-only user on your onmicrosoft.com domain in the Microsoft Entra admin center, then give it a permanent active Global Administrator assignment. Register a passkey on a FIDO2 security key, using a one-time Temporary Access Pass to start. Add the account to a dedicated group excluded from blocking Conditional Access policies, alert on every sign-in, and repeat for a second account.
Do break glass accounts need MFA?
Yes, break glass accounts need MFA. Microsoft's mandatory MFA enforcement for the Azure portal, the Microsoft Entra and Intune admin centers and, from Phase 2, Azure management tools, has no exception for them. Microsoft recommends a passkey (FIDO2) or certificate-based authentication, which satisfy the requirement. Excluding the accounts from Conditional Access doesn't exempt them, because this enforcement doesn't come from your policies.
How many break glass accounts should you have?
Microsoft recommends at least two emergency access (break glass) accounts, for redundancy. Two accounts with separate security keys in safes at different locations mean that one lost key, one unreachable site or one locked account doesn't leave you without a way in. You can instead give each administrator an individual emergency account, a variant Microsoft allows for accountability.
Should break glass accounts be excluded from Conditional Access?
Yes, exclude break glass accounts from every policy that blocks or restricts sign-in. Microsoft warns that a policy requiring MFA, a compliant device or another control could make the account unusable in the emergency it exists for. Exclude a dedicated group rather than the accounts one by one, protect that group, alert on its membership and on policy changes, and remember that report-only policies don't need the exclusion.
Related guides
- Set up Microsoft Entra PIM: keep these accounts permanent active while everyone else moves to eligible assignments.
- Block device code flow with Conditional Access: a blocking policy to exclude the group from.
- Investigate risky users in Entra ID Protection: respond when a privileged sign-in shows risk.
- Harden Entra Connect and Cloud Sync: the synchronized side these accounts don't depend on.
- Microsoft Entra ID security checklist for beginners: where emergency access fits, next to the common Microsoft Entra ID misconfigurations.
References
- Manage emergency access accounts in Microsoft Entra ID (Microsoft Learn)
- Mandatory multifactor authentication for Azure and admin portals (Microsoft Learn)
- How to enable passkeys (FIDO2) in Microsoft Entra ID (Microsoft Learn)
- Configure a Temporary Access Pass in Microsoft Entra ID to register passwordless authentication methods (Microsoft Learn)
- Use Microsoft Entra groups to manage role assignments (Microsoft Learn)
- Microsoft-managed Conditional Access policies (Microsoft Learn)
- Update conditionalAccessPolicy (Microsoft Graph)
- Troubleshoot Conditional Access policies with the What If tool (Microsoft Learn)
- Security operations for privileged accounts in Microsoft Entra ID (Microsoft Learn)
- Azure Monitor Logs reference: SigninLogs (Microsoft Learn)
- Valid Accounts: Cloud Accounts, T1078.004 (MITRE ATT&CK)
- Modify Authentication Process: Conditional Access Policies, T1556.009 (MITRE ATT&CK)
See your identity exposure clearly.
Start with a 1-day Proof of Value in your own environment.