Posts

Check the MFA Status of Office 365 Users using Powershell

Some times there is the requirements to know the status of MFA for office 365 users. We can use Powershell and get the data easily in the CSV file. Get the status of all the users. Connect-MsolService $AllOffice365Users = Get-MsolUser -All | Select UserPrincipalName -ExpandProperty StrongAuthenticationRequirements | Select UserPrincipalName, State  $AllOffice365Users | Export-csv C:\Scripts\MFAStatus.csv -NoTypeInformation If MFA is disabled, the state will be blank. Get the status for a list of users Put the User's UPN value in UPNs.txt file and execute below code $users = Get-Content C:\scripts\UPNs.txt $users | foreach-object {Get-MsolUser -UserPrincipalName $_| Select UserPrincipalName -ExpandProperty StrongAuthenticationRequirements | Select UserPrincipalName, State | Export-csv C:\scripts\MFAstatus.csv -Append}