Managing Roles with Privileged Identity Management
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 10 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Managing Roles with Microsoft Entra Privileged Identity Management (PIM)
Introduction: The Philosophy of Least Privilege
In the modern enterprise, the identity is the new perimeter. As organizations migrate their infrastructure and productivity suites to the cloud, the traditional model of "permanent administrative access" has become a significant liability. When a user account is assigned a highly privileged role—such as Global Administrator or Exchange Administrator—that access is typically active 24/7. If that account is compromised through phishing, credential stuffing, or session hijacking, the attacker gains immediate and unrestricted access to the entire environment. This is where Privileged Identity Management (PIM) becomes essential.
Privileged Identity Management is a service within Microsoft Entra ID (formerly Azure AD) that enables you to manage, control, and monitor access to important resources in your organization. Instead of granting permanent access, PIM allows you to provide "just-in-time" (JIT) access. This means that a user only gains the permissions they need for the specific window of time they need them, and only after fulfilling specific requirements like Multi-Factor Authentication (MFA) or manager approval. By moving from permanent, standing access to time-bound, audited access, you significantly reduce the attack surface of your Microsoft 365 tenant.
This lesson explores how to design, implement, and manage a PIM strategy. We will move beyond the basic interface and look at the architectural requirements, the operational workflow for administrators, and the auditing mechanisms that ensure your environment remains secure over the long term.
Not read yet
The Core Concepts of PIM
To effectively manage roles with PIM, you must first understand the distinction between "eligible" and "active" assignments. In a standard Microsoft 365 environment, an assignment is binary: you either have the role or you do not. With PIM, we introduce the concept of eligibility.
Eligible Assignments
When a user is assigned an "eligible" role, they do not have the permissions of that role by default. The role is essentially "dormant" until the user initiates an activation process. This is the ideal state for most administrative accounts. Even if the account is compromised, the attacker cannot perform administrative actions because the role has not been activated.
Active Assignments
"Active" assignments in PIM function similarly to traditional assignments, but with the added benefit of time-bounding. You might assign an administrator the "Helpdesk Administrator" role for a fixed duration of three months for a specific project. Once the time expires, PIM automatically removes the assignment. This prevents "permission creep," where users retain access to systems long after they have moved to different departments or finished their projects.
Callout: PIM vs. Standard RBAC Standard Role-Based Access Control (RBAC) is static. You assign a role, and the user keeps it until you manually remove it. PIM introduces a dynamic layer on top of RBAC. It forces a workflow—authentication, approval, and time-limits—before the RBAC permission is actually applied to the user's security token.
Not read yet
Implementing PIM: A Step-by-Step Guide
Before you can use PIM, you must ensure you have the correct licensing. PIM requires Microsoft Entra ID P2 licenses for the users who will be using the features. Once licensing is in place, the setup process follows a logical progression of discovery, policy configuration, and assignment.
1. Enabling PIM for Your Tenant
PIM is generally available in the Microsoft Entra admin center. You do not need to "install" it, but you do need to configure the initial settings. Navigate to the "Privileged Identity Management" blade in the Entra portal. The first time you access this, you may be prompted to provide consent for the service to manage your directory.
2. Defining Role Settings
Before assigning roles, you must define the "rules of engagement." These rules dictate what happens when a user requests to activate a role. You can customize these settings for each specific role (e.g., Global Administrator vs. User Administrator).
- Activation Duration: How long can a user hold the role? (Default is often 4 hours).
- MFA Requirement: Does the user need to perform an additional MFA challenge to activate the role? (Highly recommended).
- Approval Requirements: Does the user need a human reviewer to approve the request before the role is granted?
- Justification/Ticket Number: Should the user be required to provide a business reason or a service desk ticket number?
3. Configuring Role Assignments
Once the policies are set, you can start assigning users to roles as "Eligible."
- Navigate to Privileged Identity Management > Azure AD roles.
- Select Assignments > Add assignments.
- Choose the role (e.g., SharePoint Administrator).
- Select the member (the user or group).
- Set the assignment type to Eligible.
- Define the duration (or set it to permanent eligibility).
Note: While you can set permanent eligibility, it is a best practice to set an expiration date for the eligibility itself. For example, a user might be eligible for a role for one year, after which their access must be reviewed and renewed.
Not read yet
Automating PIM with PowerShell
For larger organizations, managing PIM through the portal is inefficient. You can use the Microsoft.Graph PowerShell module to automate assignments. This is particularly useful for provisioning access during onboarding or integrating with your internal ticketing system.
Example: Assigning an Eligible Role
The following script demonstrates how to assign an eligible role to a user. You will need the Directory.ReadWrite.All and RoleManagement.ReadWrite.Directory permissions.
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "RoleManagement.ReadWrite.Directory"
# Define variables
$userId = "user-guid-here"
$roleDefinitionId = "role-guid-here" # e.g., Global Admin GUID
$startTime = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ssZ")
# Create the eligible assignment
New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -RoleDefinitionId $roleDefinitionId `
-DirectoryScopeId "/" `
-PrincipalId $userId `
-ScheduleInfo @{
StartDateTime = $startTime
Expiration = @{
Type = "AfterDuration"
Duration = "P30D" # 30 days
}
} `
-Action "AdminAssign" `
-Justification "Project-based access for Q3 migration"
Understanding the Code
New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest: This is the primary cmdlet for PIM. It creates a request to schedule a role assignment.RoleDefinitionId: You must obtain the GUID for the specific role you are assigning. You can find these by runningGet-MgRoleManagementDirectoryRoleDefinition.ScheduleInfo: This defines the start time and the expiration. TheDurationparameter uses ISO 8601 format (e.g.,P30Dfor 30 days).Action: We useAdminAssignbecause we are assigning the role to someone else, rather than the user requesting it themselves.
Not read yet
Best Practices for PIM Strategy
Implementing PIM is not just a technical task; it is an organizational process change. If you do not configure it correctly, you may inadvertently create security gaps or cause frustration for your IT staff.
1. The "Break-Glass" Account Rule
One of the most common mistakes is putting your "break-glass" accounts (emergency access accounts) under the control of PIM. If your PIM configuration becomes corrupted or if there is an issue with the Microsoft Entra service, you could lock yourself out of your own tenant. Always maintain at least two highly privileged, cloud-only accounts that have permanent, non-PIM-governed access, and store their credentials in a secure, physical location (like a safe).
2. Use Groups Instead of Users
Instead of assigning roles directly to individual user accounts, assign them to Microsoft Entra groups. You can then make those groups "eligible" for PIM roles. This allows you to manage membership via standard group management workflows. When a user joins the "IT Administrators" group, they automatically inherit the ability to activate the roles assigned to that group.
3. Review Regularly
PIM includes an "Access Review" feature. Use this to conduct quarterly or semi-annual audits of who has access to what. You can configure PIM to automatically email managers or resource owners, asking them to "Approve" or "Deny" continued access for their staff. If they do not respond, you can set PIM to automatically remove the access. This is an essential control for compliance frameworks like SOC2, HIPAA, or ISO 27001.
Warning: Approval Fatigue Do not require approval for every single role activation if your IT team is large. If an administrator has to wait for a manager to approve a "Helpdesk Admin" request at 2:00 AM, they will eventually find ways to bypass the system. Require approval for high-impact roles (like Global Admin) and allow auto-approval for lower-risk roles (like Helpdesk or Teams Admin), provided they pass MFA.
Not read yet
Common Pitfalls and How to Avoid Them
Pitfall 1: Over-Privileging Service Principals
PIM is excellent for human users, but many administrators forget about Service Principals (applications). If an application has the "Global Administrator" role, that access is essentially permanent and cannot be "activated" via PIM in the same way a human does.
- Solution: Use Managed Identities whenever possible and strictly limit the scope of application permissions using App Registrations. Audit your Service Principals regularly to ensure they aren't carrying excessive roles.
Pitfall 2: Ignoring Audit Logs
PIM creates a wealth of data regarding who activated what role and when. Many organizations turn on PIM but never look at the logs until a breach occurs.
- Solution: Integrate your Entra logs with a SIEM (like Microsoft Sentinel) or a Log Analytics workspace. Set up alerts for "Global Administrator" activations so the security team receives a notification whenever a high-level role is activated.
Pitfall 3: Inconsistent Policy Application
If you have 50 roles and you only apply strict PIM policies to 5 of them, you have left 45 backdoors open.
- Solution: Develop a "Role Tiering" model. Tier 0 roles (Global Admin, Security Admin) should have the strictest policies (MFA, Approval required). Tier 1 roles (Exchange, SharePoint) should have moderate policies. Tier 2 roles (Read-only access) might require less friction.
Not read yet
Comparison: Permanent vs. PIM-Based Access
| Feature | Permanent Assignment | PIM Eligible Assignment |
|---|---|---|
| Risk Exposure | High (24/7 access) | Low (Access is JIT) |
| Auditability | Poor (Requires manual logs) | Excellent (Built-in reports) |
| User Experience | Seamless (Always on) | Friction-based (Requires activation) |
| Lifecycle | Manual removal | Automatic expiration |
| Compliance | Difficult to prove | Simple (via Access Reviews) |
Managing Privileged Groups
Microsoft Entra Privileged Identity Management also supports "Privileged Groups." This is a powerful feature that allows you to manage membership in highly sensitive groups (like "Domain Admins" or "Cloud Infrastructure Owners") using the same PIM workflow.
When a group is made "Privileged" in PIM, members of that group do not have the group's permissions by default. They must go through the same activation process as a role. This is particularly useful for on-premises groups that have been synchronized to the cloud via Microsoft Entra Connect.
Steps to Configure a Privileged Group:
- Go to Privileged Identity Management > Groups.
- Select Discover groups to find the groups you want to manage.
- Select the group and choose Manage > Settings.
- Configure the activation requirements (MFA, approval, etc.).
- Add members as "Eligible."
This approach allows you to secure sensitive administrative groups without having to change the underlying architecture of your on-premises Active Directory.
Not read yet
The Role of Access Reviews
Access reviews are the "cleanup crew" of your identity strategy. Even with PIM, users will eventually accumulate access they no longer need. An access review allows you to define a process where assigned roles are periodically validated by a designated reviewer.
Setting Up an Access Review:
- Reviewer Selection: You can choose the user themselves, their manager, or a specific group of admins.
- Duration: Decide how long the review period lasts (e.g., 14 days).
- Auto-Apply: You can enable the "Auto-apply results to resource" setting. If a reviewer denies access, PIM will automatically strip the user of that role. This removes the manual burden from your IT team.
Tip: The "Self-Review" Trap Avoid letting users review their own access. While it is convenient, it defeats the purpose of an audit. Always designate a manager or a peer-reviewer to ensure there is a separation of duties.
Not read yet
Dealing with "Hidden" Administrative Access
One of the most difficult parts of managing a tenant is finding all the places where administrative rights are granted. You might have roles assigned in the Microsoft 365 Admin Center, the Azure portal, the Security & Compliance center, and individual workload centers like Exchange Online or SharePoint.
PIM provides a "Discovery" feature that scans your tenant for permanent roles that should be brought under PIM management. When you first enable PIM, run the discovery tool to identify all current "Global Administrators." You will likely find accounts that are no longer in use, or accounts that were created for a temporary project years ago. Create a plan to migrate these permanent assignments to PIM-eligible assignments over a 30-day period.
Advanced Monitoring with Microsoft Sentinel
While the PIM dashboard provides excellent visibility, large enterprises often need to correlate PIM events with other security signals. By streaming your PIM logs into Microsoft Sentinel, you can create custom workbooks and alerts that provide deeper insights.
Example: Custom Sentinel Query
You can use KQL (Kusto Query Language) to identify suspicious activation patterns, such as an administrator activating a role outside of business hours.
AuditLogs
| where OperationName == "Add member to role completed"
| where TargetResources[0].type == "Role"
| extend RoleName = tostring(TargetResources[0].displayName)
| extend Actor = tostring(InitiatedBy.user.userPrincipalName)
| project TimeGenerated, Actor, RoleName, Result
| order by TimeGenerated desc
This query shows you exactly who is activating roles. You can extend this by adding a filter for TimeGenerated to flag activations occurring between 10:00 PM and 6:00 AM, which might warrant an investigation.
Not read yet
Summary and Key Takeaways
Managing roles with Privileged Identity Management is a foundational requirement for any secure Microsoft 365 environment. It shifts the security posture from a "trust by default" model to a "verify every time" model. By following the practices outlined in this lesson, you can significantly reduce your risk of a major security incident.
Key Takeaways:
- Adopt Just-in-Time Access: Move away from permanent administrative assignments. Every role, especially high-impact ones, should be eligible rather than active.
- Enforce MFA for Everything: Never allow an administrative role to be activated without a strong MFA challenge. This is the single most effective way to stop credential-based attacks.
- Implement Approval Workflows: For critical roles like Global Administrator, require a second set of eyes (a peer or manager) to approve the activation request.
- Use Access Reviews: Regularly audit who has access to your environment. Automate the removal of access for users who no longer require it to maintain a clean security state.
- Protect Your Break-Glass Accounts: Ensure that your emergency access accounts remain outside of the PIM workflow to prevent a "lockout" scenario if the PIM service encounters an issue.
- Leverage Groups: Use Microsoft Entra groups for PIM assignments to simplify the management of large teams and ensure consistent policy application.
- Monitor and Alert: Integrate your PIM logs with a logging platform like Microsoft Sentinel. Treat role activations as security events that warrant monitoring, not just administrative tasks.
By implementing these strategies, you are not just checking a box for compliance; you are building a resilient identity infrastructure that can withstand the evolving threats of the cloud era. PIM requires an initial investment in time and process design, but the resulting security posture is far superior to any static, permanent access model.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Creating a Microsoft 365 Tenant
- Creating a Microsoft 365 Tenant Quiz5q
- Implementing and Managing Domains
- Implementing and Managing Domains Quiz5q
- Configuring Organization Settings
- Configuring Organization Settings Quiz5q
- Monitoring Microsoft 365 Service Health
- Monitoring Microsoft 365 Service Health Quiz5q
- Configuring Network Connectivity Insights
- Configuring Network Connectivity Insights Quiz5q
- Managing Software Updates in Microsoft 365
- Managing Software Updates in Microsoft 365 Quiz5q
- Monitoring Microsoft 365 Adoption and Usage
- Monitoring Microsoft 365 Adoption and Usage Quiz5q
- Configuring Microsoft 365 Backup
- Configuring Microsoft 365 Backup Quiz5q
- Creating and Managing Users in Microsoft Entra ID
- Creating and Managing Users in Microsoft Entra ID Quiz5q
- Managing External Users and Guest Access
- Managing External Users and Guest Access Quiz5q
- Creating and Managing Contacts
- Creating and Managing Contacts Quiz5q
- Creating and Managing Microsoft 365 Groups
- Creating and Managing Microsoft 365 Groups Quiz5q
- Managing Shared Mailboxes
- Managing Shared Mailboxes Quiz5q
- Managing Microsoft 365 Licenses
- Managing Microsoft 365 Licenses Quiz5q
- Performing Bulk User Management with PowerShell
- Performing Bulk User Management with PowerShell Quiz5q
- Implementing Group-Based Licensing
- Implementing Group-Based Licensing Quiz5q
- Implementing Roles in Microsoft 365
- Implementing Roles in Microsoft 365 Quiz5q
- Managing Microsoft Entra ID Roles
- Managing Microsoft Entra ID Roles Quiz5q
- Managing Permissions for Microsoft Defender XDR
- Managing Permissions for Microsoft Defender XDR Quiz5q
- Managing Delegation with Administrative Units
- Managing Delegation with Administrative Units Quiz5q
- Managing Roles with Privileged Identity Management
- Managing Roles with Privileged Identity Management Quiz5q
- Managing Microsoft Purview Permissions
- Managing Microsoft Purview Permissions Quiz5q
- Preparing for Identity Synchronization
- Preparing for Identity Synchronization Quiz5q
- Using IdFix for Directory Cleanup
- Using IdFix for Directory Cleanup Quiz5q
- Implementing Microsoft Entra Connect Sync
- Implementing Microsoft Entra Connect Sync Quiz5q
- Implementing Microsoft Entra Cloud Sync
- Implementing Microsoft Entra Cloud Sync Quiz5q
- Monitoring with Microsoft Entra Connect Health
- Monitoring with Microsoft Entra Connect Health Quiz5q
- Troubleshooting Synchronization Issues
- Troubleshooting Synchronization Issues Quiz5q
- Implementing Authentication Methods
- Implementing Authentication Methods Quiz5q
- Implementing Self-Service Password Reset
- Implementing Self-Service Password Reset Quiz5q
- Implementing Microsoft Entra Password Protection
- Implementing Microsoft Entra Password Protection Quiz5q
- Investigating Authentication Issues
- Investigating Authentication Issues Quiz5q
- Configuring Passwordless Authentication
- Configuring Passwordless Authentication Quiz5q
- Planning for Identity Protection
- Planning for Identity Protection Quiz5q
- Implementing Microsoft Entra Identity Protection
- Implementing Microsoft Entra Identity Protection Quiz5q
- Planning Conditional Access Policies
- Planning Conditional Access Policies Quiz5q
- Implementing Conditional Access Policies
- Implementing Conditional Access Policies Quiz5q
- Implementing Multifactor Authentication
- Implementing Multifactor Authentication Quiz5q
- Configuring Named Locations
- Configuring Named Locations Quiz5q
- Understanding Microsoft Security Exposure Management
- Understanding Microsoft Security Exposure Management Quiz5q
- Managing Microsoft Secure Score
- Managing Microsoft Secure Score Quiz5q
- Reviewing and Responding to Incidents
- Reviewing and Responding to Incidents Quiz5q
- Using Advanced Hunting in Defender XDR
- Using Advanced Hunting in Defender XDR Quiz5q
- Reviewing Defender XDR Reports
- Reviewing Defender XDR Reports Quiz5q
- Using Microsoft Defender Threat Intelligence
- Using Microsoft Defender Threat Intelligence Quiz5q
- Configuring Custom Detection Rules
- Configuring Custom Detection Rules Quiz5q
- Implementing Threat Policies in Defender for Office 365
- Implementing Threat Policies in Defender for Office 365 Quiz5q
- Configuring Alert Policies
- Configuring Alert Policies Quiz5q
- Investigating Email and Collaboration Threats
- Investigating Email and Collaboration Threats Quiz5q
- Managing Attack Simulation Training
- Managing Attack Simulation Training Quiz5q
- Managing Restricted Entities
- Managing Restricted Entities Quiz5q
- Onboarding Devices to Defender for Endpoint
- Onboarding Devices to Defender for Endpoint Quiz5q
- Configuring Endpoint Settings
- Configuring Endpoint Settings Quiz5q
- Using Vulnerability Management Dashboard
- Using Vulnerability Management Dashboard Quiz5q
- Responding to Endpoint Vulnerabilities
- Responding to Endpoint Vulnerabilities Quiz5q
- Managing Automated Investigation and Remediation
- Managing Automated Investigation and Remediation Quiz5q
- Configuring App Connector for Microsoft 365
- Configuring App Connector for Microsoft 365 Quiz5q
- Configuring Cloud Apps Policies
- Configuring Cloud Apps Policies Quiz5q
- Interpreting Activity Logs
- Interpreting Activity Logs Quiz5q
- Configuring Cloud App Discovery
- Configuring Cloud App Discovery Quiz5q
- Responding to Cloud App Discovery Issues
- Responding to Cloud App Discovery Issues Quiz5q
- Implementing Sensitive Information Types
- Implementing Sensitive Information Types Quiz5q
- Using Keywords and Regular Expressions
- Using Keywords and Regular Expressions Quiz5q
- Implementing Retention Labels and Policies
- Implementing Retention Labels and Policies Quiz5q
- Implementing Sensitivity Labels and Policies
- Implementing Sensitivity Labels and Policies Quiz5q
- Monitoring Label Usage with Content Explorer
- Monitoring Label Usage with Content Explorer Quiz5q
- Using Activity Explorer and Label Reports
- Using Activity Explorer and Label Reports Quiz5q
- Configuring Auto-Labeling Policies
- Configuring Auto-Labeling Policies Quiz5q
- Configuring DLP Policies for Exchange Online
- Configuring DLP Policies for Exchange Online Quiz5q
- Configuring DLP for SharePoint and OneDrive
- Configuring DLP for SharePoint and OneDrive Quiz5q
- Configuring DLP for Teams and Power BI
- Configuring DLP for Teams and Power BI Quiz5q
- Configuring DLP for Microsoft 365 Copilot
- Configuring DLP for Microsoft 365 Copilot Quiz5q
- Configuring Endpoint DLP
- Configuring Endpoint DLP Quiz5q
- Reviewing DLP Alerts and Events
- Reviewing DLP Alerts and Events Quiz5q
- Responding to DLP Reports
- Responding to DLP Reports Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock MS-102 exam-style practice questions.
Practice for MS-102