directory_audits
Retrieve directory audit logs to see who performed admin actions on user objects, enabling triage to distinguish human-handled incidents from unresolved ones.
Instructions
Who did what to the directory, and when -- the operator-side counterpart to signin_logs.
Every admin action against a user object (block/unblock, password reset,
role assignment, attribute edits) appears here, naming the actor
(initiated_by) and the affected object(s) (target_resources).
This is the record a manual "unblock and reset" intervention -- like the
one that closed the 2026-08-21 case this server exists to shorten --
leaves behind; it is how a later triage can tell "already handled by a
human" from "still open".
user, when given, matches audits where that account is either the
initiator or a target resource. Graph's directoryAudits endpoint only
supports server-side $filter on the initiator
(initiatedBy/user/userPrincipalName), not on targetResources, so
this fetches the full time window and matches both sides client-side --
a window with many unrelated admin actions can need a larger
max_pages budget than signin_logs/signin_failure_stats to
find one specific user's audits; capped=true warns when that budget
ran out before the window was fully scanned.
Read-only (AuditLog.Read.All application permission, or -- for azure-cli auth -- the Reports Reader directory role). Entra ID retains directory audit logs for 30 days, same as sign-in logs.
Args: user: Restrict to audits naming this userPrincipalName as actor or target (default: all). hours: How far back to look, clamped to [1, 720] (30 days). top: Maximum records to return, clamped to [1, 500]. max_pages: Page budget (default: ENTRAADM_MAX_PAGES_DEFAULT).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | ||
| user | No | ||
| hours | No | ||
| max_pages | No |