Export Office 365 Users MFA Status to CSV using PowerShell

Using this PowerShell script you can export Office 365 users' MFA status along with many useful attributes like Display Name, User Principal Name, MFA Status, Activation Status, Default MFA Method, All MFA Methods, MFA Phone, MFA Email, License Status, Admin Roles, SignIn Status.

GetMFAStatus.ps1
 
 
 
 
 
4.5 Star
(2)
2,160 times
Add to favorites
Office 365
12/4/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • MFA export on Multiple domain
    4 Posts | Last post October 29, 2019
    • we have multiple domains and i would like to export on a single domain, is it possible?
    • Hi,
      
      Did you mean multiple alias in a single domain?
    • Hi Kathy, 
      
      we do have multiple Alias but also we have multiple domains in our 365 tenant. we have 4 different domains and users have accounts on all when I export i get the email addresses from all 4 domain
      
      
    • Hi Shaff_Khans,
      Currently, the script supports a single domain at a time. If you want to get a report from 4 domains, run the script with each domain credential separately.
  • Help with disable report
    2 Posts | Last post October 17, 2019
    • Can you assist with what exactly needs changed to run the report to find and display disabled users? I've made a few changes but reports still only pulls Enforced/Enabled users. thanks!!
    • Hi,
      You don't need to edit anything in the script. The script has many inbuilt filters. To get a list of MFA disabled users, run the script with -DisabledOnly switch.
          ./GetMFAStatus.ps1 -DisabledOnly
       
      For more advanced filtering options, please refer: https://o365reports.com/2019/05/09/export-office-365-users-mfa-status-csv
  • Script stuck/hanfgs after checking 10862 records.
    2 Posts | Last post October 09, 2019
    • Hi, I tried to use this script. It takes a lot of time but gives required info. However, it also hangs after processing large number of users. 
      Mostly it get stuck after processing 10862 accounts. 
    • Hi,
      Sorry for the inconvenience.Are you getting any exception during script execution?
  • How to schedule the script if MFA enabled on my account?
    2 Posts | Last post October 09, 2019
    • How to schedule the script if MFA enabled on my account?
    • You can schedule this script with MFA, but you need to enter credential and verification code at the time of script execution. 
      For more info refer: https://o365reports.com/2019/08/02/schedule-powershell-script-task-scheduler/
  • When running the script with switch -DisabledOnly.
    1 Posts | Last post October 04, 2019
    • I tried running the script as is and generate the mfa enabled users. 
      However, when I try running the same using -DisabledOnly switch. it takes much more time and get stuck at some point. Kindly help explain what can be done to solve such situation. 
      
  • users included in conditional access policy
    1 Posts | Last post October 02, 2019
    • I have created a directive that when a series of users belonging to that directive try to connect from outside my organization, it asks for the double factor.
      
      When executing the script these users do not appear in the list.
      
      Why is this behavior?
  • users included in conditional access policy
    1 Posts | Last post October 02, 2019
    • users included in conditional access policy
      
      I have created a directive that when a series of users belonging to that directive try to connect from outside my organization, it asks for the double factor.
      
      When executing the script these users do not appear in the list.
      
      Why is this behavior?
  • No Users Found/Only discovering mysel
    2 Posts | Last post September 02, 2019
    • Hi,
      
      I'm currently using the script at the moment, however at the moment whenever I execute the script the only results I get back is myself. (16300+ Other Users)
      
      I tried then executing this script on an SVC account that we run other scheduled O365 scripts and I got this 
      
      ./GetMFAStatus.ps1 -LicensedUserOnly
      
      Script executed successfully
      No user found that matches your criteria.
      
      Would you know any reason why this might be happening? My feeling is that its permission based but the SVC account I used is at a high privilege set. Thoughts would be appreciated!
      
      Cheers,
      
      E.Laver
    • Hi Mario
      
      Simply, you are not global admin.
      Only with global admin rights you can retrieve all the users status. Otherwise you will be able to retrieve yours.
      
      Cheers
      Chris
  • Thanks this help me a lot !
    2 Posts | Last post August 30, 2019
    • I was able to find what I needed this one is lot more simple than what you posted here
      for Disabled or Enabled reports like I wanted:
      
      https://office365itpros.com/2018/11/21/reporting-mfa-enabled-accounts/
      
      Thanks everyone!
    • Hi Mario,
      
      We have designed this script to provide a more detailed report on MFA status. This script not only focuses on MFA status, but it also focuses on the most required attributes based on user's MFA status. In short,
      
           - For MFA enabled users, it lists user's MFA activation status, Default MFA method, MFAPhone, MFAEmail, etc. whereas for MFA disabled users, it contains user's department, IsAdmin, SignIn Status, etc.
           - This script is Scheduler Friendly.
           - This script provides advanced filtering options (You can filter the result based on MFA status, Licensed users, Admin users, and SignIn Status)
           - This script gets user's MFA status set by Conditional Access too.
  • Missing Department
    2 Posts | Last post August 24, 2019
    • I ran the -DisabledOnly, however didn't see the department populate in the csv.  Otherwise, this is a great script!!!  Thank you for creating!
    • Hi,
      Thank you for pointing it out. We have updated the script. Now, you can see department value in the CSV file. You can download the updated version.
1 - 10 of 17 Items