Attackers use AI to automate phishing and social engineering, and an intercepted SMS code or push approval is enough to open the door to an account. If that account holds a standing administrator role, the exposure extends far beyond a single mailbox. This audit guide gives you a method, a read-only script and a decision grid to find weak MFA methods and standing privileges in Microsoft Entra ID, formerly Azure AD.
Why this audit comes before AI agents
On October 29, 2026, Microsoft published a message from Melanie Maynes on the Microsoft Entra blog. It reminds readers that the principles that protect users must extend to every agent identity. The accompanying guide, Secure identity to get ready for AI, sets out three workstreams in order: phishing-resistant MFA (multifactor authentication), removal of standing privileges with Microsoft Entra Privileged Identity Management (PIM), and a unified policy engine.
The logic of the order is simple: an AI agent inherits the hygiene of your tenant. If your administrators authenticate by SMS and keep Global Administrator permanently, adding agent identities only enlarges an already fragile surface. Auditing human accounts first is therefore a prerequisite, not an optional step.
Scope of this guide
The audit covers two measurable risks: weak authentication methods registered on privileged accounts, and active Entra role assignments with no end date. AI agents are covered further down, once this foundation has been cleaned up.
Which MFA methods should be considered weak?
A method is weak as soon as an attacker can obtain or relay the second factor without possessing the victim's device. Microsoft's message explicitly cites SMS codes and push approvals as interceptable. The methods to aim for are device-bound passkeys, FIDO2 security keys, Windows Hello for Business, synced passkeys and certificate-based authentication.
| Method | Phishing-resistant | Audit verdict |
|---|---|---|
| SMS / voice call | No (interceptable, according to Microsoft) | Remove first for administrators |
| Push approval | No (interceptable, according to Microsoft) | Replace for privileged accounts |
| One-time code (email, TOTP app) | No: the code can be relayed by a fake site | Treat as weak (expert reasoning) |
| FIDO2 security key | Yes | Target for administrators |
| Device-bound passkey | Yes | Target for administrators |
| Windows Hello for Business | Yes | Target for Windows devices |
| Synced passkeys | Yes, according to the Microsoft guide | Broad deployment option; generally available since March 2026 |
| Certificate-based authentication | Yes | Option for PKI environments |
Synced passkeys have been generally available in Microsoft Entra ID since the March 2026 announcement, according to the Microsoft Entra releases and announcements page. For administration accounts, Microsoft's recommendation remains device-bound passkeys or FIDO2 keys. Synced passkeys are better suited to deployment across the general population.
Why a standing role makes everything worse
A standing assignment exposes the role 24 hours a day, even when nobody is using it. A token stolen on a Sunday evening therefore carries the same rights as a token issued in the middle of an intervention. PIM replaces this model with eligible roles, activated for a limited time with justification and MFA.
Microsoft's guide recommends running PIM discovery, then converting static roles into time-limited activations. The page Discovery and insights (preview) for Microsoft Entra roles in PIM describes this wizard, which the documentation flags as being in preview. Guests, for their part, are governed by expiring access packages.
Keep emergency access before any conversion
Before converting assignments to eligible, check that your emergency access accounts remain usable and excluded from blocking policies. This is a precautionary recommendation: a poorly prepared conversion can lock you out of the tenant.
Implementation
The script below is read-only: it lists active Entra role assignments with no end date, then classifies the authentication methods of the accounts concerned. It writes nothing to the tenant, so no simulation mode is needed.
- Modules:
Microsoft.Graph.Authentication,Microsoft.Graph.Identity.GovernanceandMicrosoft.Graph.Identity.SignIns. - Delegated permissions:
RoleManagement.Read.DirectoryandUserAuthenticationMethod.Read.All. The account running the script must also hold an Entra role authorised to read other users' authentication methods; check the exact role in the Microsoft Graph documentation. - Output: a CSV file
audit-privileges.csvand a summary by verdict in the console.
1Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Identity.Governance, Microsoft.Graph.Identity.SignIns -Scope CurrentUser1# Connexion avec les deux permissions minimales, en lecture seule2Connect-MgGraph -Scopes 'RoleManagement.Read.Directory','UserAuthenticationMethod.Read.All' -NoWelcome3 4# Types de méthodes tels que renvoyés par Microsoft Graph5$faibles = @('#microsoft.graph.phoneAuthenticationMethod','#microsoft.graph.emailAuthenticationMethod','#microsoft.graph.softwareOathAuthenticationMethod')6$resistantes = @('#microsoft.graph.fido2AuthenticationMethod','#microsoft.graph.windowsHelloForBusinessAuthenticationMethod')7 8# Toutes les instances d'affectation, avec le principal et la définition du rôle9$affectations = Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All -ExpandProperty 'principal,roleDefinition'10 11# Affectation permanente = active (Assigned) sans date de fin ; les activations PIM (Activated) sont exclues12$permanentes = $affectations | Where-Object { $_.AssignmentType -eq 'Assigned' -and -not $_.EndDateTime }13 14$rapport = foreach ($a in $permanentes) {15 $props = $a.Principal.AdditionalProperties16 $nature = ($props['@odata.type'] -replace '#microsoft.graph.', '')17 $methodes = ''18 $verdict = 'Non évalué (principal non utilisateur)'19 20 if ($nature -eq 'user') {21 try {22 # Liste des méthodes enregistrées pour ce compte23 $types = @(Get-MgUserAuthenticationMethod -UserId $a.PrincipalId | ForEach-Object { $_.AdditionalProperties['@odata.type'] })24 $methodes = ($types | ForEach-Object { $_ -replace '#microsoft.graph.', '' }) -join ';'25 $aResistante = @($types | Where-Object { $resistantes -contains $_ }).Count -gt 026 $aFaible = @($types | Where-Object { $faibles -contains $_ }).Count -gt 027 28 if (-not $aResistante) { $verdict = 'À corriger : aucune méthode résistante' }29 elseif ($aFaible) { $verdict = 'À durcir : méthodes faibles encore actives' }30 else { $verdict = 'Conforme côté MFA' }31 }32 catch {33 $verdict = 'Erreur de lecture : ' + $_.Exception.Message34 }35 }36 37 [pscustomobject]@{38 Role = $a.RoleDefinition.DisplayName39 Compte = $props['userPrincipalName']40 Nom = $props['displayName']41 Nature = $nature42 Methodes = $methodes43 Verdict = $verdict44 }45}46 47$rapport | Export-Csv -Path './audit-privileges.csv' -NoTypeInformation -Encoding UTF848$rapport | Group-Object Verdict | Select-Object Count, Name | Format-Table -AutoSizeTo isolate the most urgent work, filter the CSV on accounts with no resistant method:
1Import-Csv -Path './audit-privileges.csv' | Where-Object { $_.Verdict -like 'Ă€ corriger*' } | Sort-Object Role | Format-Table Role, Compte, Methodes -AutoSizeThe same view in the portal
Open the PIM Discovery and insights page for Microsoft Entra roles: it identifies standing assignments and offers to convert them to eligible. For MFA methods, review each user's authentication methods from the account's page.
Troubleshooting the audit
| Symptom | Likely cause | Resolution |
|---|---|---|
| 403 error on Get-MgUserAuthenticationMethod | UserAuthenticationMethod.Read.All permission not consented, or insufficient Entra role | Re-run Connect-MgGraph with the scope, consent, then check the audit account’s role |
| No standing assignment returned | RoleManagement.Read.Directory scope missing from the session | Run Disconnect-MgGraph then reconnect with both scopes |
| Verdict Non évalué (principal non utilisateur) | The role is assigned to a group or a service principal | Audit group members and application identities separately |
| An account with a FIDO2 key keeps weak methods | A registered method remains usable until it is removed or restricted | Remove the method or restrict the allowed methods by policy |
Extending coverage: policies and risk signals
The guide's third workstream is to apply Conditional Access to all identities and resources. In practice: block legacy authentication, require device compliance via Microsoft Intune, and enable Microsoft Entra ID Protection to enforce MFA at medium risk and credential reset at high risk.
Monitoring is part of the setup. Microsoft recommends exporting logs to Microsoft Sentinel or Azure Monitor, alerting on privileged role activations and scheduling recurring access reviews. An alert on every PIM activation turns an eligible role into an actionable signal.
AI agents: what the audit should already cover
Microsoft Entra Agent ID, the identity and authorisation framework for AI agents based on OAuth 2.0, MCP and A2A, has been generally available since April 2026, according to the Microsoft Entra releases and announcements page.
March 2026
Consolidated agent registry
The agent registry is consolidated in Microsoft Agent 365, which becomes the unified registry and control plane. Entra remains the identity layer through Agent ID. The old registry Graph API will be deprecated, with no date announced at the verification date, and agents registered through that API will need to be re-registered.
April 2026
Entra Agent ID generally available
Agent ID is available to all Entra customers.
May 1, 2026
Agent 365 generally available
General availability for the Commercial segment, per user. At least one user must hold a qualifying Agent 365 licence to enable it.
The pitfalls identified by the Zero Trust Assessment
The Zero Trust Assessment documentation flags two risks that your audit can check right now:
- without a “block unless approved” Conditional Access policy, every agent token request is allowed by default;
- a disabled agent or blueprint keeps its role assignments, group memberships and OAuth2 consents; reactivation restores all permissions without new approval.
The hygiene rule follows from this: clean up disabled objects and assign technical owners to every agent. For governance, see our article on AI agent governance with Agent 365 and Entra Agent ID.
Licences required for agent Conditional Access
According to Microsoft Learn documentation, Conditional Access for agents requires Microsoft 365 E7, or an Agent 365 licence combined with at least Entra ID P1 or Microsoft 365 E3. Two separate policies are needed: one for the agent identity, one for the agent's user account. Policies targeting “Users” do not apply to agent accounts; you must target “Agents”.
On the incident response side, when an agent is confirmed compromised, its risk level moves to High, and a policy that blocks on “High Agent Risk” blocks it automatically. During the preview, Identity Protection for agents required an Entra ID P2 licence; check the current conditions before relying on it. The Agent ID Administrator (agent management) and Agent ID Developer (blueprint creation) roles let you separate responsibilities.
Frequently asked questions
Do I need a particular licence to use Entra Agent ID?
Not for Agent ID itself: it is available to all Entra customers. However, extending Entra's security features to agents, such as Conditional Access and governance, requires Microsoft Agent 365. This licence is included in Microsoft 365 E7 and is available as an add-on for E5, A5 and Business Premium.
Does a Conditional Access policy targeting an agent also cover its user account?
No. A policy targeting the agent identity does not cover the agent's user account, and vice versa. It also does not cover requests made on behalf of a user (OBO), which are evaluated against the user. Plan for separate policies.
Are synced passkeys ready for production?
Yes, they have been generally available in Microsoft Entra ID since the March 2026 announcement. For administration accounts, however, Microsoft's guide still favours device-bound passkeys or FIDO2 keys.
Where to start
Start with the script: in a single run, you know how many privileged accounts combine a standing role and weak MFA. Then treat those accounts before the rest of the population.
Four-step action plan
- Run the audit script and archive the CSV as a baseline
- Register a device-bound passkey or a FIDO2 key for every administrator with the À corriger verdict
- Convert standing assignments to eligible via PIM, after validating the emergency access accounts
- Check Conditional Access policies, log export to Microsoft Sentinel or Azure Monitor, and disabled agents that still hold permissions
If your organisation already hosts AI agents, add now the inventory of their owners and the “block unless approved” policy. Otherwise, first finish the three human workstreams: they are the foundation your future agents will inherit. To go deeper into the architecture, see Microsoft Entra ID: architecture and key components and Zero Trust AI: securing agents with Microsoft.
Going further
- Plan a phishing-resistant passwordless authentication deployment in Microsoft Entra ID: the deployment plan for phishing-resistant methods.
- Conditional Access for Agents in Microsoft Entra: licences, access patterns and limits of policies targeting agents.
- Configure agent identity security with the Zero Trust Assessment: concrete checks to run in the tenant, including orphaned agents.
- Governing Agent Identities - Microsoft Entra ID Governance: granting agents access through access packages, sponsors and owners.
- Microsoft Entra security for AI overview: risk scenarios and associated Entra controls.



