Audit Azure and Microsoft Entra activity with PowerShell

Published · Updated

Save

Choose the log by what you are trying to answer. Entra sign-in logs cover authentication, Entra audit logs record directory changes, and Azure Activity Log records control-plane events for Azure resources.

Pick the right query

Use Microsoft Graph PowerShell Get-MgAuditLogSignIn for sign-ins and Get-MgAuditLogDirectoryAudit for directory changes. For subscription events, use Get-AzActivityLog in the correct subscription context. Check documented privileges and use the narrowest authorized role and scope.

Make an audit reproducible

Write down the tenant or subscription and a UTC interval, then verify pagination, retention and diagnostic export settings. A missing row can reflect the wrong scope, permissions or retention. Redact identities and source addresses before sharing results.

References

Entra reporting PowerShell cmdlets

Azure Activity Log

Discuss this answer