Just-in-Time Administrator Rights with Entra ID PIM

How do you turn permanent Global Admin assignments into time-limited rights? Activation duration, approval, MFA, role-based settings, emergency accounts and access reviews in Entra ID PIM.
Technical summary
Technology
Microsoft Entra ID, Privileged Identity Management, Conditional Access, Access Reviews, Microsoft Graph PowerShell
Topic
Just-in-time authorization for Entra roles
Level
Intermediate–advanced
Prerequisites
  • A Microsoft Entra ID P2 or Entra ID Governance license
  • Privileged Role Administrator or Global Administrator rights
In this article8 sections

In most Microsoft 365 tenants, the Global Administrator role sits on a few permanently assigned accounts accumulated over the years. These accounts are open with full rights at every hour of the day; a single session cookie theft hands the whole tenant to an attacker. Microsoft Entra Privileged Identity Management (PIM) turns these permanent assignments into time-limited, auditable rights opened when needed. Below we explain role settings, recommended values by role group, emergency accounts and access reviews in implementation order.

The risk of a permanent administrator role

From an enterprise cybersecurity perspective, the problem with standing privilege is that the rights stay open even during hours when they aren’t used. While the administrator reads email, opens a web page or looks at personal matters, all of the account’s administrative rights are active. When one of these accounts’ password or session token is stolen, the attacker adds new administrators, disables Conditional Access policies, adds secrets to app registrations and establishes persistence. They do this within minutes.

Start by seeing what’s permanently assigned in the tenant. Active role assignments are listed with Microsoft Graph PowerShell; those without an end date are flagged as permanent:

Connect-MgGraph -Scopes "RoleManagement.Read.Directory","Directory.Read.All"

$roles = @{}
Get-MgRoleManagementDirectoryRoleDefinition -All |
    ForEach-Object { $roles[$_.Id] = $_.DisplayName }

Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All |
    Select-Object @{n='Role';e={$roles[$_.RoleDefinitionId]}},
                  PrincipalId, AssignmentType,
                  @{n='Permanent';e={-not $_.EndDateTime}} |
    Sort-Object Role | Format-Table -AutoSize

Rows with an AssignmentType value of Assigned show directly assigned active roles, and those with Activated show roles temporarily activated through PIM. The goal is clear: apart from emergency accounts, no permanent active privileged role assignments should remain. The first report often shows that an old consultant, a departed employee or a test account is still a Global Administrator.

The difference between eligible and active assignments

PIM works with two assignment types:

  • Eligible assignment: The user can use the role but must activate it first. On activation, the conditions in the role settings (MFA, justification, approval) are applied; the role stays active only for the set duration.
  • Active assignment: The role is used without needing activation. It can be time-limited (e.g. two weeks for a project) or permanent.

Both types can be defined as time-limited or permanent. The structure we recommend: daily administrators work with eligible, time-limited assignments, and service accounts work with application permissions instead of roles wherever possible. PIM requires a Microsoft Entra ID P2 or Microsoft Entra ID Governance license; verify who needs to be licensed on Microsoft’s current licensing page.

Role activation is a separate control from user risk and sign-in risk policies. Risk policies evaluate the session based on Entra ID Protection signals; PIM determines when, under what conditions and for how long the role becomes active.

Role settings: duration, approval, MFA, justification

Each Entra role has a separate set of settings within PIM. The path: Identity Governance > Privileged Identity Management > Microsoft Entra roles > Settings. The parameters to look at:

  • Maximum activation duration: Chosen between 1 and 24 hours. A short duration narrows the risky window; if it’s kept too short, administrators activate many times a day and look for ways to get around the process.
  • Authentication on activation: “Azure MFA” or a Conditional Access authentication context can be required. Authentication context is stronger because it can enforce conditions such as a phishing-resistant method or a compliant device at the moment of activation.
  • Justification and ticket number: Ties the reason for activation to the change record in the audit log.
  • Approval: The role doesn’t activate until one of the designated approvers approves. The user can’t approve their own request.
  • Assignment duration limits: Whether eligible and active assignments can be made permanent and, if not, their maximum duration.
  • Notifications: Emails sent to administrators, the role holder and approvers when a role is assigned and when it’s activated.

Applying the same settings to all roles produces one of two results: either unnecessary friction or insufficient protection for the most critical roles. The table below is a starting point; adapt it to your own operating model.

Role group Maximum duration Approval Authentication
Global Administrator, Privileged Role Administrator 1–2 hours Yes Phishing-resistant (context)
Security Administrator, Conditional Access Administrator 2–4 hours Yes Phishing-resistant (context)
Exchange, SharePoint, Intune Administrator 4–8 hours Optional MFA, preferably context
User Administrator, Helpdesk Administrator 8 hours No MFA
Read roles (Global Reader, Security Reader) 8 hours or active No MFA

Keep the maximum duration of eligible assignments at one year or less and renew them with access reviews; this is how assignments piling up over the years are stopped. Keep the number of Global Administrators low. Most work is done with narrower roles. How phishing-resistant methods are rolled out to users is described in the FIDO2 and passkey migration plan article.

Emergency accounts and their monitoring

When approvers can’t be reached, when federation or the MFA service goes down, or when a wrong Conditional Access policy locks all administrators out, PIM alone can’t keep administration going. Emergency (break-glass) accounts are set up for these moments:

  • At least two accounts; permanently active Global Administrators.
  • Cloud-only, on the *.onmicrosoft.com domain; not synchronized from on-premises AD and not tied to federation.
  • Not tied to a specific person; no mailbox or license required.
  • Excluded from Conditional Access policies that block or restrict sign-in, but authenticated with a phishing-resistant method such as a FIDO2 security key or certificate-based authentication. The MFA requirement Microsoft has introduced for its admin portals covers these accounts too.
  • Keys and any password fragments are stored in physically separate, secure places; the access process is written down.
  • A sign-in test is done at regular intervals (e.g. once a quarter) and recorded. An untested emergency account doesn’t work on the day of a crisis.

Every sign-in with these accounts should raise an alarm. If sign-in logs flow to a Log Analytics workspace, the query below can be tied to an alert rule:

SigninLogs
| where UserPrincipalName in~ ("[email protected]",
                               "[email protected]")
| project TimeGenerated, UserPrincipalName, IPAddress,
          AppDisplayName, ResultType, Location

Instead of names that give away their purpose, like “bg-emerg” in the example, choose names that don’t follow the corporate naming template but are recorded in the written procedure. Leave the alert rule covering all successful and failed attempts (without a ResultType filter); a failed attempt also shows the account is being targeted.

PIM for Groups and Azure resource roles

PIM isn’t limited to Entra directory roles:

  • PIM for Groups: Membership or ownership of a security group or Microsoft 365 group can be given as an eligible assignment. This way, role-assignable groups grant multiple roles with a single activation; it also provides just-in-time authorization for access that isn’t an Entra role (e.g. an application’s administrator group).
  • Azure resource roles: Azure RBAC roles such as Owner, Contributor and User Access Administrator at the management group, subscription or resource group level can be made eligible with PIM. A permanent Owner assignment at the subscription level needs as much attention as a permanent Global Administrator in Entra; it’s the assignment most often overlooked in audits.

Unlike general roles such as User Administrator, membership of role-assignable groups can be managed only by Privileged Role Administrator, Global Administrator and the group’s owners. This means a group owner can effectively hand out access to the roles that group grants. When bringing groups into PIM, narrow ownership according to the principle of least privilege too; consider turning ownership into an eligible assignment with PIM as well.

Access reviews and audit logs

PIM assignments pile up over time too; the eligible assignment of someone who left a project stays in place. Access reviews clean up this buildup regularly:

  1. Plan quarterly reviews for privileged roles and semi-annual reviews for low-risk roles.
  2. Choose the person’s manager or the role owner as the reviewer; don’t allow self-review for highly privileged roles.
  3. Set the default decision for unanswered reviews to “remove access” and turn on automatic application of results.
  4. Highlight users whose last activation was long ago. An eligible assignment that is never activated is an unnecessary assignment.

All assignment, activation and approval operations in PIM are written to the Entra audit log; they’re also tracked in PIM’s own audit history. In Log Analytics, the Category == "RoleManagement" filter on the AuditLogs table returns these events. Direct role assignments made outside PIM, i.e. someone bypassing PIM to make a permanent assignment, deserve a separate alarm. Silent backsliding happens most often here.

Implementation order: first create and test the emergency accounts; then report permanent assignments; configure role settings; convert permanent assignments into eligible assignments; and last, put access reviews and alarms in place. For administrator separation on the on-premises AD side, the Active Directory tier model is a complement, and for the tenant’s general controls, the Microsoft 365 security checklist. The full list of role settings is in Microsoft’s PIM documentation. For designing privileged access processes, see our privileged access management page, and for the tenant configuration as a whole, our Microsoft 365 security page.

Frequently asked questions

Which license is required to use PIM?

PIM requires a Microsoft Entra ID P2 or Microsoft Entra ID Governance license. Because which users need to be licensed (eligible assignees, approvers, reviewers) can be updated by Microsoft, verify the scope in Microsoft’s current licensing documentation.

Should emergency accounts also be made eligible with PIM?

No. The job of emergency accounts is to keep administration going during a lockout caused by PIM, the MFA service or Conditional Access. That’s why they stay permanently active Global Administrators; the risk is managed with phishing-resistant authentication, secure storage and monitoring that raises an alarm on every sign-in.

How long should the activation duration be?

In PIM, the activation duration is set between 1 and 24 hours. For the most critical roles such as Global Administrator, 1–2 hours, and for daily operations roles, 4–8 hours is a common start. If it’s too short, administrators have to reactivate constantly; monitor the activation frequency and adjust.

How are role assignments made outside PIM noticed?

Role addition events in the RoleManagement category of the Entra audit logs are monitored. An alarm is set up in Log Analytics or the SIEM for direct assignments not made through PIM; a permanent assignment report is run regularly to catch unexpected assignments.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Cybersecurity

Firewall, VPN, endpoint security and threat prevention. We reduce the attack surface and measure and report the risks.

Knowledge Center

Other articles