Query Details
// Entra ID Administrative Role (AD-Sync) IdentityInfo | where Timestamp > ago(30d) | where AssignedRoles != "" | mv-expand AssignedRoles | extend EntraAdminRole = tostring(AssignedRoles) | where OnPremSid != "" | distinct EntraAdminRole, AccountUpn | where AccountUpn != "" | sort by EntraAdminRole asc
This KQL query retrieves and processes information about administrative roles assigned to identities within the last 30 days. Here's a simple summary:
IdentityInfo table to include only those from the past 30 days.EntraAdminRole.EntraAdminRole and AccountUpn.AccountUpn are included.EntraAdminRole in ascending order.In essence, this query identifies unique user accounts with specific administrative roles assigned in the last 30 days, ensuring all necessary fields are present and sorting the results by role.

Steven Lim
Released: August 21, 2024
Tables
Keywords
Operators