Query Details
// Monthly Report Entra Eligible Role Activation // https://www.linkedin.com/posts/activity-7195656523899965442-aZTj/ // Entra offers an “Alert detail” view that monitors whether eligible administrators are activating their privileged roles. However, it lacks a built-in feature to measure the frequency of these activations. To overcome this, you can schedule the following KQL query to run every 30 days. This will generate a report detailing the activation history of eligible administrators’ roles over a specified timeframe. It’s important to adhere to the principle of least privilege and revoke any roles that are excessively provisioned and not necessary. 😎 IdentityInfo | where Timestamp > ago(30d) | where AssignedRoles != "" | mv-expand AssignedRoles | extend EntraAdminRole = tostring(AssignedRoles) | distinct EntraAdminRole, AccountUpn | where AccountUpn != "" | sort by EntraAdminRole asc
This KQL query is designed to generate a monthly report on the activation history of eligible administrators' roles in Entra. Here's a simplified breakdown:
IdentityInfo table.AssignedRoles is not empty).AccountUpn).AccountUpn) is empty.The purpose of this query is to help monitor and report on how often eligible administrators activate their privileged roles, ensuring adherence to the principle of least privilege by identifying and potentially revoking unnecessary role assignments.

Steven Lim
Released: August 2, 2024
Tables
Keywords
Operators