PowerShell command for export users from admin center

Anonymous
2025-03-25T06:24:43+00:00

Whenever I attempt to export the users report from the Admin Center, it downloads a blank report. Could someone please assist me with a PowerShell command to export the same report?

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

9 answers

Sort by: Most helpful
  1. Anonymous
    2025-03-27T15:23:20+00:00

    This appears to be a larger issue. I have access to several tenants, and they all fail to download data, just get a 412 byte CSV with headers: No User Data.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2025-03-27T13:59:59+00:00

    apparently this is not isolated to this user and a much larger consensus.

    We are also experiencing the same issue...

    Report exports with headers but columns are blank.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2025-03-26T07:03:14+00:00

    Hi Vishal Prajapati3,

    Good day. Hope you are doing well.

    Thank you for posting back. As your inquiry is related to PowerShell cmdlets, we have a separate community team, hence it is recommended to post through PowerShell - Microsoft Q&A, so that a support agent from that team can verify and provide you with the necessary information.

    Thank you for your kind understanding and cooperation.

    Sincerely,

    Roger Shen

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2025-03-26T05:52:00+00:00

    Thanks, Roger, for your reply. However, when I try to run the point 4 command in PowerShell, I get the following error: "The command does not exist." Can you help me with this?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2025-03-25T08:22:57+00:00

    Hi Vishal Prajapati3

    Good day! Thank you for posting to Microsoft Community. We are happy to assist you.

    I am truly sorry for the inconvenience this issue has caused you. Based on the description, I understand that you have an issue with export users from the M365 admin center with PowerShell cmdlets

    Please understand that this Microsoft answers community is mainly handling or helping users to troubleshoot certain kind of issues of Microsoft 365 for business products, and we are also guiding correct platform to users for some specific concern and requirement. As your inquiry is related to PowerShell cmdlets, we have a separate community team, hence it is recommended to post through PowerShell - Microsoft Q&A, so that a support agent from that team can verify and provide you with the necessary information.

    After doing some research and tests, here are a general guideline on how to view Microsoft 365 user accounts with PowerShell. For details, please see: View Microsoft 365 user accounts with PowerShell - Microsoft 365 Enterprise | Microsoft Learn.

    1. First, install the required software to use Microsoft Graph PowerShell. See Connect to Microsoft 365 with Microsoft Graph PowerShell for more information. The Azure Active Directory (AzureAD) PowerShell module is being deprecated and replaced by the Microsoft Graph PowerShell SDK.
    2. Then run the following cmdlet to connect to your organization with the required permission scope, which in this case is User.ReadBasic.All:
      • Connect to Microsoft Graph

      • Connect-Graph -Scopes User.Read.All
    3. To display the full list of user accounts with user ID and user principal name, run this command:
      • Get-MgUser -All | Select DisplayName,Id,UserPrincipalName
    4. Use the following command to export the users report to a CSV file:
      • Get-MgUser -All | Select-Object DisplayName, UserPrincipalName, Mail | Export-Csv -Path "C:\Users\YourUsername\Documents\UsersReport.csv" -NoTypeInformation
      • This script will export the display name, user principal name, and email of all users to a CSV file located at C:\Users\YourUsername\Documents\UsersReport.csv. Make sure to replace folder path with where you actually want it.

    I hope I have provided you with all the required information to progress the situation. You may also give vote on my reply. With your vote, other users who are facing the same issue can easily find this thread and check suggestion when they search on community. Your vote helps other user to clarify their queries as well. 

    Feel free to let me know if you have any questions.

    Sincerely,

    Roger Shen

    Was this answer helpful?

    0 comments No comments