Updated MFA Report to include default MFA method
This commit is contained in:
parent
74a83e7444
commit
38a31f1f62
@ -24,7 +24,11 @@ foreach ($user in $users) {
|
||||
$mfaMethods = Get-MgUserAuthenticationMethod -UserId $user.Id
|
||||
|
||||
# Check if any MFA method is registered
|
||||
$mfaRegistered = $mfaMethods.Count -gt 0
|
||||
$mfaRegistered = $mfaMethods.Count -gt 1
|
||||
|
||||
# Check the preferred MFA method
|
||||
$uri = "https://graph.microsoft.com/beta/users/$($user.Id)/authentication/signInPreferences"
|
||||
$currentDefaults = Invoke-MgGraphRequest -Uri $uri -Method GET -OutputType PSObject
|
||||
|
||||
# Get user licenses
|
||||
$licenses = Get-MgUserLicenseDetail -UserId $user.Id
|
||||
@ -35,7 +39,8 @@ foreach ($user in $users) {
|
||||
DisplayName = $user.DisplayName
|
||||
AccountEnabled = $user.AccountEnabled
|
||||
MFARegistered = $mfaRegistered
|
||||
MFAMethods = ($mfaMethods.AdditionalProperties.'@odata.type' -join ', ').Replace('#microsoft.graph.', '')
|
||||
DefaultMFAMethod = $currentDefaults.userPreferredMethodForSecondaryAuthentication
|
||||
AuthenticationMethods = ($mfaMethods.AdditionalProperties.'@odata.type' -join ', ').Replace('#microsoft.graph.', '')
|
||||
Licenses = ($licenses.SkuPartNumber -join ', ')
|
||||
}
|
||||
|
||||
|
||||
BIN
PMM/.DS_Store
vendored
BIN
PMM/.DS_Store
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user