Audit¶
The audit stage: a tamper-evident trail of every administrative change in Intune. Each event names an actor, the activity, the resources it touched and the result — the first stop for "why did this setting change?".
flowchart LR
E["audit_events"] --> A["actor\nwho (UPN or app)"]
E --> R["resources\nwhat changed"]
E --> D["activityDateTime\nwhen"]
Start here¶
| Script | What / why | Permissions |
|---|---|---|
events.py |
Browse the audit trail for the last N days, filter by category, and optionally list the affected resources. | DeviceManagementApps.Read.All or an Intune admin role |
Reading an event¶
activityis the verb (Update deviceConfiguration,Wipe),activityResultissuccess/failure.actoris anAuditActor; useuserPrincipalNamefor a person orapplicationDisplayNamefor an app/automation.resourcesis a collection ofAuditResource, each with a type, display name and the properties that were modified.
The
AuditActor/AuditResourcemodels use the raw OData attribute names (userPrincipalName,displayName). Access them directly on the object, as the script does.