try
{
    Get-MsolDomain -ErrorAction Stop > $null
}
catch 
{
    Write-Host "Connecting to Microsoft Online Service..."
    Connect-MsolService
}

$Users = get-msoluser -All | where {$_.UserType -eq "Member"}


$Users | Select-Object @{N='UserPrincipalName';E={$_.UserPrincipalName}},@{N='Legacy MFA Status';E={if ($_.StrongAuthenticationRequirements.State){$_.StrongAuthenticationRequirements.State} else {"Disabled"}}},@{N='MFA Methods';E={$_.StrongAuthenticationMethods.methodtype}} | Export-Csv -Path c:\temp\MFA_Report.csv -NoTypeInformation