Audit MFA stavu uživatelů
Export přehledu, kteří uživatelé mají a nemají nastavenou vícefaktorovou autentizaci — přes Microsoft Graph.
powershell
Connect-MgGraph -Scopes "UserAuthenticationMethod.Read.All", "Reports.Read.All"
Get-MgUser -All | ForEach-Object {
$methods = Get-MgUserAuthenticationMethod -UserId $_.Id
[PSCustomObject]@{
Uzivatel = $_.UserPrincipalName
MFA_Aktivni = ($methods | Where-Object { $_.AdditionalProperties["@odata.type"] -notmatch "passwordAuthenticationMethod" }).Count -gt 0
}
} | Export-Csv -Path "C:exportmfa-audit.csv" -NoTypeInformation -Encoding UTF8 -Delimiter ";"