technet:graph:preferredauthmethods
Reporting User-Preferred MFA Methods for Azure AD User Accounts
Connect-MgGraph -Scopes UserAuthenticationMethod.ReadWrite.All Select-MgProfile Beta [array]$Users = Get-MgUser -Filter "assignedLicenses/`$count ne 0 and userType eq 'Member'" -ConsistencyLevel eventual -CountVariable Records -All $Report = [System.Collections.Generic.List[Object]]::new() ForEach ($User in $Users) { $Uri = ("https://graph.microsoft.com/beta/users/{0}/authentication/signInPreferences" -f $User.Id) $AuthData = Invoke-MgGraphRequest -Uri $Uri -Method Get $ReportLine = [PSCustomObject]@{ User = $User.displayName UPN = $User.userPrincipalName 'System preferred MFA enabled' = $AuthData.isSystemPreferredAuthenticationMethodEnabled 'System preferred MFA method' = $AuthData.systemPreferredAuthenticationMethod 'Secondary auth method' = $AuthData.userPreferredMethodForSecondaryAuthentication } $Report.Add($ReportLine) }
Source: https://office365itpros.com/2023/06/21/report-user-authentication-methods/
technet/graph/preferredauthmethods.txt · Last modified: 2023/06/21 08:22 by fk