Sourcetable Integration

Export Azure users to CSV

Jump to


    Welcome to your go-to resource for managing and analyzing Azure Active Directory (AD) user data efficiently. Exporting Azure users to a CSV file is an essential process for administrators and IT professionals, offering a simplified way to create a comprehensive report that includes detailed user attributes, which can then be easily loaded into spreadsheet applications like Microsoft Excel for further analysis and customization. On this page, we'll delve into what Azure users are, guide you through the process of exporting Azure users to a CSV file using the Export-AADUsers.ps1 PowerShell script, explore various use cases for the exported data, introduce an alternative to CSV exports for Azure users via Sourcetable, and provide a helpful Q&A section to address common inquiries about the export process. Empower your organization with the ability to seamlessly integrate Azure user data with external systems, dashboards, and financial systems for enhanced operational insights and strategic decision-making.

    Azure Users

    Azure users are individuals or entities that have been granted access to an Azure tenant, which is a dedicated and secure instance of Azure Active Directory (Azure AD). They can be managed by User Administrators or Global Administrators within an organization, who are responsible for adding or deleting users from the tenant.

    When creating a new user, specific information is required, including the user principal name and display name. The user principal name must include a domain that is either the default domain provided by Azure, which follows the format yourdomainname.onmicrosoft.com, or a custom domain name that the organization has set up. It is important to note that accent characters are not permitted in the user principal name or display name.

    Users can be organized within the Azure environment by adding them to groups, administrative units, or roles. They can also be manually created in Azure AD B2C, and for organizations using on-premises directories, users can be integrated with Azure through Microsoft Entra ID. If a user needs to be deleted from the Azure tenant, this action is performed using the Microsoft Entra admin center, and only users with specific administrative roles, such as Global Administrator, Privileged Authentication Administrator, or User Administrator, have the authority to delete users.

    Should a user be deleted, there is a 30-day window during which they can be restored. Additionally, any licenses that were assigned to a deleted user become available for reassignment to other users.

    Exporting Azure Users to a CSV File

    Using Export-AADUsers.ps1 Script

    The Export-AADUsers.ps1 script is designed to extract user information from Azure Active Directory and export it to a CSV file. This script is executed within the Azure tenant and retrieves a comprehensive set of user attributes, including ID, names, user principal name, email, job title, manager information, department, and much more. To ensure a smooth import into applications such as Microsoft Excel, the script sorts the users by display name prior to export. It utilizes the Get-AllMgUsers cmdlet to fetch user details and the Export-Csv cmdlet to create the CSV file, with UTF8 encoding, no type information, and a semicolon as the delimiter.

    Exporting from Azure AD Portal

    To export users from the Azure AD portal, a user with admin privileges should navigate to the Microsoft Admin center. From there, the steps include selecting Users > All users > Download users to initiate the download of user profiles. The downloaded data, which includes the user attributes, will be in CSV format. Post-download, the progress and status of the bulk operation can be monitored on the Bulk operation results page. Please note that each bulk operation can handle the export of up to 500,000 users and runs for a maximum of one hour.

    Using M365 Manager Plus

    M365 Manager Plus is a comprehensive tool that simplifies the export of users from Azure AD. With over 700 preconfigured reports, the platform supports multiple export formats such as PDF, XLS, CSV, and HTML. To export user data, navigate to the reports tab within M365 Manager Plus, select the desired report, and click the export button to generate the file in the chosen format.

    Sourcetable Integration

    Streamline Your Azure User Management with Sourcetable

    Transitioning Azure user data into a spreadsheet format is pivotal for efficient management and analysis. While the traditional method of exporting Azure users to a CSV file and then importing into a spreadsheet program is an option, it introduces unnecessary extra steps and potential for manual errors. Sourcetable offers a seamless solution that outperforms this dated process, providing a host of benefits that streamline your workflow.

    With Sourcetable, you can directly import your Azure user data into a dynamic spreadsheet. This eliminates the need for exporting and re-importing data, thereby saving time and reducing the risk of data inconsistencies. Sourcetable's ability to sync your live data from Azure ensures that your spreadsheet is always up-to-date, offering real-time insights that are essential for informed decision-making and maintaining accurate records.

    Moreover, Sourcetable's familiar spreadsheet interface allows for immediate productivity without the steep learning curve often associated with specialized data management tools. It simplifies the process of querying and manipulating data, making it accessible for team members of all technical levels. The automation capabilities within Sourcetable reduce the manual workload, enabling you to focus on strategic analysis and business intelligence rather than data entry and maintenance tasks.

    In conclusion, Sourcetable is a compelling alternative to the traditional CSV export-import cycle. It provides a more efficient, accurate, and user-friendly means of managing your Azure user data within a spreadsheet environment. Embrace Sourcetable for a streamlined approach to data integration and business intelligence.

    Common Use Cases

    • A
      Sourcetable Integration
      Ensuring every user has the correct attributes in Azure Active Directory
    • A
      Sourcetable Integration
      Providing information for the service desk
    • A
      Sourcetable Integration
      Combining information from multiple scripts into a single CSV
    • A
      Sourcetable Integration
      Exporting users from multiple Azure AD groups into a consolidated list

    Frequently Asked Questions

    How can I export Azure AD users to a CSV file using PowerShell?

    You can use the Export-AADUsers.ps1 PowerShell script, which utilizes the Microsoft Graph PowerShell modules to retrieve Azure AD users with the 'Get-AllMgUsers' cmdlet and exports them to a CSV file using the 'Export-Csv' cmdlet.

    What information does the Export-AADUsers.ps1 script include in the CSV file?

    The script gathers a lot of information about each Azure AD user and exports a detailed report of the gathered information into the CSV file.

    Can I open the exported CSV file in Excel?

    Yes, the CSV file can be opened in Excel or any other application that supports CSV files.

    Do I need to install any modules before running the Export-AADUsers.ps1 script?

    Yes, you should always install and update the Microsoft Graph PowerShell and Microsoft Graph Beta PowerShell modules to the latest version before running the script.

    What are the best practices after exporting Azure AD users to a CSV file?

    Best practices include authenticating each user, verifying the CSV file after exporting, moving the script to the scripts folder before running it, and exporting the CSV file to the C:temp folder.


    In summary, exporting Azure AD users to a CSV is a streamlined process that involves the use of a PowerShell script and requires the installation and updating of both Microsoft Graph PowerShell and Microsoft Graph Beta PowerShell modules. It is essential to follow the outlined steps, from installing the necessary modules, connecting to Microsoft Graph PowerShell, and preparing the script, to running it and reviewing the exported data. Adhering to best practices such as using specific commands for user retrieval and sorting ensures the accuracy and utility of your exported data. However, if you're looking to bypass the complexities of scripting and want a more direct approach, consider using Sourcetable. Sourcetable enables you to import data directly into a spreadsheet, providing a seamless integration experience. Sign up for Sourcetable today to get started and enhance your data management capabilities.

    Start working with Live Data

    Analyze data, automate reports and create live dashboards
    for all your business applications, without code. Get unlimited access free for 14 days.