Skip to content

Instantly share code, notes, and snippets.

@alexverboon
Last active April 29, 2021 09:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexverboon/09716a6ce0f4441e7d31bfef8c2802f3 to your computer and use it in GitHub Desktop.
Save alexverboon/09716a6ce0f4441e7d31bfef8c2802f3 to your computer and use it in GitHub Desktop.
Get MFA Stats
# run the modified mfa info gathering script stored here
# https://gist.github.com/alexverboon/f8fd3300dcf999e1a5f5554cad05030d
$mfa = .\MfaAuthMethodsAnalysis.ps1 -TenantId <TENANT ID>
$MFA_Inactive = @($MFA | Where-Object {$_.MfaAuthMethodCount -eq 0})
$MFA_Active = @( $MFA | Where-Object {$_.MfaAuthMethodCount -gt 0})
$MFA_Inactive_NoLicense = @($MFA | Where-Object {$_.MfaAuthMethodCount -eq 0 -and $_.IsLicensed -eq $False})
$MFA_Active_NoLicense = @($MFA | Where-Object {$_.MfaAuthMethodCount -gt 0 -and $_.IsLicensed -eq $False})
$MFA_InActive_HasLicense = @($MFA | Where-Object {$_.MfaAuthMethodCount -eq 0 -and $_.IsLicensed -eq $true})
$MFA_Active_HasLicense = @($MFA | Where-Object {$_.MfaAuthMethodCount -gt 0 -and $_.IsLicensed -eq $true})
$MFAResults = [PSCUSTOMOBJECT][ordered]@{
MFA_Active = $MFA_Active.Count
MFA_Inactive = $MFA_Inactive.Count
MFA_Inactive_NoLicense = $MFA_Inactive_NoLicense.Count
MFA_Active_NoLicense = $MFA_Active_NoLicense.Count
MFA_InActive_HasLicense = $MFA_InActive_HasLicense.Count
MFA_Active_HasLicense = $MFA_Active_HasLicense.Count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment