# Import AD user details Last updated: August 13, 2026 This page explains how to import Active Directory (AD) user details into MDM to enable configuration of AD-based profiles such as Email and Exchange. Administrators can either upload a CSV file exported from Active Directory using a PowerShell script or use the CSV template downloaded directly from MDM. The page covers required CSV column formats, mandatory fields (USER_NAME, EMAIL_ADDRESS, DOMAIN_NAME), and key rules such as domain name being modifiable only once after import. This lets you import the Active Directory of your organization to ensure configuration of AD-based profiles such as E-mail, Exchange etc., You can either upload the [CSV file downloaded from AD](https://www.manageengine.com/mobile-device-management/help/configuring_mdmp_cloud/mdm_import_ad_users.html#adcsv) or download the [CSV file provided by MDM](https://www.manageengine.com/mobile-device-management/help/configuring_mdmp_cloud/mdm_import_ad_users.html#mdmcsv), modify the CSV file and upload it to the MDM Server. ## Upload CSV file downloaded from AD 1. To export the AD users list as a CSV file, run the following script using Powershell in the machine where Active Directory is installed. ```powershell Get-ADUser -Filter * -Properties * | Select-Object -Property SamAccountName,EmailAddress | Sort-Object -Property Name | ConvertTo-CSV | Out-File ://.csv ``` 1. Provide in the directory details and obtain the CSV file containing the list of users. The obtained CSV file will contain default values and in some cases, data might be blank. Ensure all the required data is provided before upload. 2. Modify the headers **SamAccountName and EmailAddress to USER_NAME and EMAIL_ADDRESS** respectively. 3. Add an additional column DOMAIN_NAME and fill in the AD-domain for the users. 4. Upload the CSV file, after verifying its adherence to the [specified CSV format](https://www.manageengine.com/mobile-device-management/help/configuring_mdmp_cloud/mdm_import_ad_users.html#csvformat). ## Upload the CSV file downloaded from MDM 1. Click on the **Enrollment** tab and click **Import AD users**. 2. Click on the **Download CSV** file link. Modify the user name and domain name in the CSV file. 3. Upload the modified CSV file by clicking the **Upload** button. Note: The CSV file downloaded from MDM contains the list of users managed using MDM. You may also upload self-created CSV files, provided it adheres to the format specified below. ### Sample CSV format ```csv USER_NAME,EMAIL_ADDRESS,DOMAIN_NAME,PHONE_NUMBER user1, user1@domain.com, domain, +countrycode-number user2, user2@domain.com, domain, +countrycode-number ``` 1. USER_NAME, EMAIL_ADDRESS and DOMAIN_NAME are mandatory columns. **USER_NAME**: AD user name **EMAIL_ADDRESS**: E-mail address used for enrollment(same as the e-mail specified in the Active Directory). **DOMAIN_NAME**: AD domain to which the particular user belongs to. **PHONE_NUMBER**: The user's mobile number to which a SMS enrollment invite can be sent 2. Details for all the 3 columns are to be provided. PHONE_NUMBER is an optional field. 3. For CSV file downloaded from MDM, ensure only user name and domain name is modified as the e-mail address is used to map the user name in the MDM. 4. Domain name can be modified only once. The domain name is retained and cannot be changed later. ## Frequently Asked Questions 1. **Can I edit the CSV file before uploading it to MDM?** Yes. Whether you export the CSV from Active Directory or download it from MDM, you can modify the file to ensure it adheres to the required USER_NAME, EMAIL_ADDRESS, DOMAIN_NAME, and PHONE_NUMBER format before uploading. 2. **Which columns are mandatory in the CSV file?** USER_NAME, EMAIL_ADDRESS, and DOMAIN_NAME are mandatory columns. PHONE_NUMBER is optional and is used to send an SMS enrollment invite. 3. **Can I change a user's domain name after it has been imported?** No. The domain name can be modified only once; after that, it is retained and cannot be changed.