Microsoft Entra ID (Azure AD) Privileged Identity Management (PIM) and role governance rely heavily on role assignment schedules. But in real admin life, what you often need is simple:
“Show me the active role assignments right now — who has which role, and from what schedule?”
That’s exactly what Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance does.It retrieves instances of active directory role assignments in your tenant — including assignments created directly, through schedules, or via activation requests.
Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.
Module: Microsoft.Graph.Identity.Governance
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance ` [-ExpandProperty <string[]>] [-Property <string[]>] [-Filter <string>] [-Search <string>] [-Skip <int>] [-Sort <string[]>] [-Top <int>]
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -UnifiedRoleAssignmentScheduleInstanceId <string>
To run this cmdlet, your account/app needs at least one of these permissions:
Delegated:
Application:
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance
What this does:
Returns all active directory role assignment schedule instances in your tenant (paged by default).
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -UnifiedRoleAssignmentScheduleInstanceId y-RKGSaxskC9W2CRs4CXfQ2WD2IVpTlHiKEl01ZMWJY-1
What this does:
Fetches only the specific schedule instance matching that ID — useful for investigations or audits.
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance | export-csv d:/abcdef.csv
What this does:
Exports the retrieved schedule instances to a CSV file for reporting or compliance archives.
Import-Module Microsoft.Graph.Identity.Governance
If the module isn’t loaded, the cmdlet won’t be found.
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All
This avoids missing assignments beyond the first page.
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All -Property Id,PrincipalId,RoleDefinitionId,StartDateTime,EndDateTime
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All -ExpandProperty "principal,roleDefinition,directoryScope"
This cmdlet is especially useful for:
| Error | Cause | Solution |
|---|---|---|
| “Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance : The term is not recognized…” | Module not installed or imported. | Install-Module Microsoft.Graph.Identity.Governance Import-Module Microsoft.Graph.Identity.Governance |
| Insufficient privileges to complete the operation | Cause: Wrong ID Instance no longer active ID copied from a different object type (e.g., schedule request) |
First list instances and confirm the ID: Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -Top 50 Then retry with the correct value. |
| Empty output | Cause: No active schedule instances currently You are filtering too narrowly Results are paged and you didn’t use -All |
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All |
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance is your go-to Graph PowerShell cmdlet for pulling active Entra directory role assignment schedule instances.
It helps you:
For large environments, combine it with -All, -Property, and -ExpandProperty to get clean, performance-friendly output.
© m365corner.com. All Rights Reserved. Design by HTML Codex