To export an Active Directory user list to Excel, run Get-ADUser in Windows PowerShell and save the results as a CSV file, then open or import that file in Excel. You will need permission to read the user accounts and either the Active Directory PowerShell module or access to Active Directory Users and Computers (ADUC). The steps below cover a full-domain export, choosing useful fields, and importing the file cleanly.
What You’ll Need
- A Windows computer connected to your organization’s network or VPN, with access to the relevant Active Directory domain.
- Permission to view the user information you intend to export. Some attributes may be restricted by your organization’s access policies.
- Microsoft Excel for Microsoft 365 on Windows.
- For the PowerShell method: the Active Directory module for Windows PowerShell, commonly installed with Remote Server Administration Tools (RSAT). You can check whether it is available by running
Get-Module -ListAvailable ActiveDirectory.
Step-by-Step
- Decide which users and fields you need. A full-domain list can include disabled accounts, service accounts, and accounts that are not used for everyday sign-in. Decide whether you need every user object or only a particular organizational unit (OU). Also choose fields before exporting: a practical directory list might include the account name, display name, email, department, job title, enabled status, and account creation date. Avoid exporting personal or sensitive attributes unless you have a valid business need and authorization.
- Open Windows PowerShell and load the Active Directory module. Search the Start menu for Windows PowerShell and open it. Administrator elevation is not always required to read directory data, but your account still needs appropriate directory permissions. Enter
Import-Module ActiveDirectoryand press Enter. If PowerShell reports that the module cannot be found, install or ask your IT administrator to install RSAT’s Active Directory tools, or use the ADUC alternative described below. Do not substitute a similarly named module or run the command on an untrusted computer. - Run a query for the accounts and attributes you want. The following example returns user objects throughout the domain and selects a set of commonly useful properties. Replace the output path if you want to save the file somewhere other than your desktop.
Get-ADUser -Filter * -Properties DisplayName,GivenName,Surname,UserPrincipalName,Mail,Department,Title,Enabled,whenCreated,LastLogonDate | Select-Object SamAccountName,DisplayName,GivenName,Surname,UserPrincipalName,Mail,Department,Title,Enabled,whenCreated,LastLogonDate | Export-Csv -Path "$env:USERPROFILE\Desktop\ADUsers.csv" -NoTypeInformation -Encoding UTF8The
-Filter *option asks for all user objects the account can read; it does not mean “only currently active employees.” The selected properties determine the columns in the output. For example,Enabledhelps you distinguish enabled from disabled accounts.LastLogonDateis a convenient directory value, but it is replicated and may not reflect the most recent sign-in with the precision required for auditing. Confirm the meaning of fields with your directory administrator before using them for policy or access decisions. - Limit the export to an OU when appropriate. To avoid a domain-wide file, add a search base to the query. Replace the sample distinguished name with the exact distinguished name of your OU; the domain components and OU names must match your environment. For example, an OU called Sales in the contoso.com domain has a search base such as
OU=Sales,DC=contoso,DC=com. Add-SearchBase "OU=Sales,DC=contoso,DC=com" -SearchScope Subtreeimmediately after-Filter *in the first line of the command. Subtree includes users in nested OUs. If you only want objects directly inside that OU, use-SearchScope OneLevelinstead. Check the distinguished name carefully; a typo can return no users or the wrong scope. - Check that PowerShell created the CSV. Look on your desktop for
ADUsers.csv. If the file is not there, read the error in the PowerShell window before trying again. A successful command may not print a confirmation message. You can verify the file exists by enteringTest-Path "$env:USERPROFILE\Desktop\ADUsers.csv";Truemeans the file is present. If the file already existed, the export may have replaced it, so choose a new file name when you need to preserve an earlier snapshot. - Import the CSV into Excel. In Excel, choose Data > From Text/CSV, browse to
ADUsers.csv, and select it. In the preview, check that the delimiter is Comma, the columns are separated correctly, and the text is readable. Choose Load to place the data in a worksheet. Importing through this menu is preferable to double-clicking when you need to control how Excel interprets the data, especially if an account name or other field could be mistaken for a number or date. - Review and save the workbook. Check the headers and a few records against ADUC or another approved directory view. Confirm the row count is plausible, the expected OU scope was used, and values such as
Enabledappear in the right column. Then use File > Save As and choose Excel Workbook (*.xlsx) to keep an editable Excel copy. Keep the original CSV if you need an unmodified export for traceability, and store both files only in an approved location. - Use ADUC if PowerShell is unavailable. Open Active Directory Users and Computers, browse to the domain or OU you want, and select the container. In the console, choose Action > Export List (or right-click the selected container and choose Export List, if shown). Choose a filename and the available text or CSV format in the save dialog. If the export is a text file, use Excel’s Data > From Text/CSV import and select the delimiter shown by the preview rather than assuming it is comma-separated. ADUC’s list export may include only the columns currently displayed, so configure visible columns first using View > Add/Remove Columns. The exact available columns depend on the view and directory tools installed.
Common Mistakes
- Assuming all returned accounts are active employees. A domain-wide query can include disabled accounts, test accounts, and service accounts. Use the
Enabledfield to identify account status, and confirm any inclusion rules with the person requesting the report. - Exporting the wrong scope. A search base with the wrong OU name or domain components can produce an empty list or a list from a different location. Verify the distinguished name and whether nested OUs should be included.
- Opening the file without checking how Excel parses it. Directly opening a CSV can cause Excel to interpret some values automatically. Use the import preview when column separation, text handling, or character encoding matters.
- Expecting every directory attribute to appear automatically. PowerShell only exports the properties requested in the command’s property list and selected in
Select-Object. ADUC exports may depend on the displayed columns. Add the fields you need before exporting. - Sharing a directory file too widely. Names, email addresses, departments, and account status can be sensitive organizational information. Do not email or upload the file to an unapproved service, and remove copies when they are no longer needed under your organization’s retention rules.
Tips
- Use a date in the filename, such as
ADUsers-2026-11-03.csv, when keeping periodic snapshots. This makes it easier to tell exports apart and reduces the chance of overwriting an earlier report. - Export only the columns needed for the task. A smaller, focused file is easier to review and exposes less directory information.
- Keep identifiers such as
SamAccountNameandUserPrincipalNamealongside display names. Display names are not always unique, while an account identifier helps distinguish people with similar names. - For repeat reporting, save the PowerShell command in an approved script file and document the scope, selected fields, and export date. Have an administrator review a script if you are not responsible for directory reporting.
- When you sort or filter the imported data, convert the range to a table with Home > Format as Table. Confirm that the table includes the header row so Excel’s filters are attached to the right field names.
- On Excel for Mac or Excel for the web, the CSV can still be opened, but the import options and ribbon layout may differ from Windows. If delimiter or encoding controls are needed and are not available in your version, use Excel for Microsoft 365 on Windows or ask your administrator for an approved import method.
Troubleshooting
- “Get-ADUser” is not recognized: The Active Directory module is not installed or loaded. Try
Import-Module ActiveDirectory. If that fails, ask IT about installing RSAT or use ADUC if it is available. On a managed device, do not install administrative tools without approval. - The export has no rows or fewer users than expected: Check that you are connected to the correct domain or VPN, that your account can read the target OU, and that the search base is spelled correctly. Remove the OU restriction temporarily only if you are authorized to query the wider domain. Also remember that a query returns directory user objects, not necessarily a current staff roster.
- The CSV has only a header or seems incomplete: Review the PowerShell output for an error and confirm that the query reached the intended scope. Try exporting a smaller OU to isolate a permission or connectivity issue. If the export is very large, consult IT about approved reporting tools and storage rather than repeatedly creating large local copies.
- Excel puts everything in one column: Import again with Data > From Text/CSV and check the delimiter in the preview. Select comma for a standard CSV. For an ADUC text export, choose the delimiter that matches its preview; the file may be tab-delimited.
- Names look incorrect or characters are garbled: Import the file through the data import workflow and check the file origin or encoding setting offered by Excel. The PowerShell example writes UTF-8. If the output came from another tool, ask its administrator which encoding it uses.
- The file is missing or access is denied: Confirm the path in the command, that the destination folder exists, and that you can write there. Use a folder you are permitted to use, and avoid saving directory data to a shared or public location.
Frequently Asked Questions
Can I export Active Directory users directly to an Excel file?
PowerShell’s Export-Csv creates a CSV, which Excel can import and save as an .xlsx workbook. This is a reliable way to control the fields and scope. ADUC may also export a list, depending on the available format options.
Does Get-ADUser -Filter * include disabled accounts?
It can. The command queries user objects, not just enabled accounts. Include the Enabled property in the export and apply an agreed rule if the report should exclude disabled accounts.
How do I export users from just one OU?
Add -SearchBase with that OU’s distinguished name and choose -SearchScope Subtree for nested OUs or OneLevel for direct contents only. Confirm the name and scope with your directory administrator if unsure.
Why are department, email, or title cells blank?
The property may not be populated on those directory accounts, may not be readable to your account, or may have a different attribute name in your environment. A blank value does not necessarily indicate a failed export.
Can I export users from more than one domain?
You generally need to query each domain with suitable permissions and connection details, then combine the results using an approved process. Do not assume a query against one domain automatically includes every domain in an organization.
Is the export a live connection to Active Directory?
No. The CSV is a snapshot of the values returned when the command ran. If you need updated information, rerun the query; handle each new export as directory data and store it according to your organization’s rules.
Related
- How to Duplicate Microsoft Excel Files, Sheets, and Cells
- How to Duplicate an Excel Sheet in Excel for Windows
- How to Duplicate an Excel Document on Windows Safely
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Insert a Curved Line in Word and Adjust Its ShapeTo insert a curved line in Microsoft Word, choose Insert > Shapes, select Curve in the Lines group,…
- Excel Power Query: Combine Files From a Folder EasilyIn Excel for Microsoft 365 on Windows, choose Data > Get Data > From File > From Folder,…
- Google Sheets Duplicate Rows: Find and Remove ThemYes. In Google Sheets, select the data range and choose Data > Data cleanup > Remove duplicates to…
- Excel Solver: What It Does and How to Use It EffectivelyIn Excel, Solver is an add-in that finds values for selected cells to maximize, minimize, or reach a…
- Replace Data in Excel: Find and Replace GuideTo replace data in Excel, press Ctrl+H, enter the existing content in Find what and the new content…
- Excel Weekly Meal Planner: Build a Reusable TemplateAn Excel weekly meal planner is a worksheet that lays out meals by day, helps you turn those…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.