M365 – Azure AD Inactive Users (PowerShell)
Find inactive Microsoft Entra ID users for an access review.
Connect-MgGraph -Scopes 'AuditLog.Read.All','User.Read.All' -NoWelcome
$since = (Get-Date).AddDays(-90)
Get-MgAuditLogSignIn -Filter "createdDateTime ge $($since.ToString('o'))" -All |
Group-Object userId | Where-Object {$_.Count -eq 0} | Select -ExpandProperty Name
From Joseph Nakhle's automation workbench.
More Other tools scripts