get list of single factor authentication users with Azure CLI

Tod Jolayemi 20 Reputation points
2024-06-12T15:45:48.98+00:00

do we have a command to get list of single factor authentication users with Azure CLI

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

2 answers

Sort by: Most helpful
  1. Miguel Gonçalves 971 Reputation points
    2024-06-12T16:20:23.8966667+00:00

    Hi Tod,

    To retrieve a list of users with single-factor authentication (SFA) enabled using Azure CLI, you can use the following command

    "az ad user list --query "[?authenticationType=='password']" --output table"

    https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli

    0 comments No comments

  2. Babafemi Bulugbe 4,025 Reputation points MVP Volunteer Moderator
    2024-06-12T16:43:26.9566667+00:00

    Hello Tod Jolayemi,

    Thank you for posting your query in the Microsoft Q&A Community.

    I am not sure of the CLI command but take a look at the command provided by Miguel Gonçalves

    However, in case you would like to use a PowerShell script to complete this, then the below should work for you.

    Install-Module MSOnline
    
    Connect-MsolService
    
    Get-MsolUser -All | Select-Object DisplayName, UserPrincipalName, @{N="MFA Status"; E={ if($_.StrongAuthenticationRequirements.State -ne $null) { $_.StrongAuthenticationRequirements.State } else { "Disabled" } }}
    
    

    Let me know if further assistance is needed.

    Babafemi

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.