Search-UnifiedAuditLog

Identifying Obsolete Guest User Accounts in an Office 365 Tenant

with 2 Comments by Tony Redmond

Many Office 365 applications now create Azure Active Directory guest accounts. What's the best way to discover if the accounts are active and in use? This PowerShell script uses the Office 365 audit log and message trace data to figure out what guest accounts are active and outputs a CSV file for your review and analysis. Like any other PowerShell script, it can be adapted to suit your purposes.