diff --git a/src/Export-MsIdAzureMfaReport.ps1 b/src/Export-MsIdAzureMfaReport.ps1 index 0173821..8a75cee 100644 --- a/src/Export-MsIdAzureMfaReport.ps1 +++ b/src/Export-MsIdAzureMfaReport.ps1 @@ -234,7 +234,9 @@ function Export-MsIdAzureMfaReport { foreach ($method in $methodsRegistered) { $methodInfo = $authMethods | Where-Object { $_.ReportType -eq $method } if ($null -eq $methodInfo) { $userAuthMethod += $method } - else { $userAuthMethod += $methodInfo.DisplayName } + else { + if($methodInfo.IsMfa) { $userAuthMethod += $methodInfo.DisplayName } + } } $user.AuthenticationMethods = $userAuthMethod -join ', ' $user.IsMfaRegistered = Get-ObjectPropertyValue $resultsJson -Property 'isMfaRegistered' @@ -340,10 +342,8 @@ function Export-MsIdAzureMfaReport { Write-Progress -Id 0 -Activity $activity -PercentComplete $percent -Status $Status } - # #, Mobile phone, Office phone, Alternate mobile phone, Security question, , , Hardware OATH token, FIDO2 security key, , Microsoft Passwordless phone sign-in, , , Passkey (Microsoft Authenticator), Passkey (Windows Hello) - function GetAuthMethodInfo($type) { - $methodInfo = $authMethods | Where-Object { $_.Type -eq $type } + $methodInfo = $authMethods | Where-Object { $_.Type -eq $type} if ($null -eq $methodInfo) { # Default to the type and assume it is MFA $methodInfo = @{ diff --git a/src/Get-MsIdAzureUsers.ps1 b/src/Get-MsIdAzureUsers.ps1 index b512100..fe6cc06 100644 --- a/src/Get-MsIdAzureUsers.ps1 +++ b/src/Get-MsIdAzureUsers.ps1 @@ -83,6 +83,8 @@ function Get-MsIdAzureUsers { return } + $dayDiff = (Get-Date).Subtract($earliestDate).Days + Write-Host "Getting sign in logs for the last $dayDiff days (from $earliestDate to now)..." -ForegroundColor Green $graphUri = (GetGraphBaseUri) + "/beta/auditLogs/signIns?`$select=$select&`$filter=$filter" Write-Verbose "Getting sign in logs $graphUri"