Exporting AD Information to Excel

Posted on 2014-03-10
Last Modified: 2014-04-24
Hello, I have a Windows Server 2008 DC and want to export a list of all the users along with their email address and telephone number information from AD.  Can some one please provide a script on how to do this?

Thank you
Question by:hyperbyte
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 21

Assisted Solution

RK earned 100 total points
ID: 39917398

Refer this which details about your requirement.

Hope this helps
LVL 21

Expert Comment

ID: 39917407
LVL 18

Accepted Solution

TobiasHolm earned 200 total points
ID: 39917433
dsquery user -name * -limit 20000 | dsget user -dn -display -samid -email -tel

Open in new window

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 14

Assisted Solution

by:Justin Yeung
Justin Yeung earned 200 total points
ID: 39917498

get-aduser -filter * -properties * | select-object Name,EmailAddreess,HomePHone,MobilePhone,OfficePhone | Export-csv c:\export.csv
LVL 18

Expert Comment

ID: 39917639
Notice: my script (one liner) above was for a command shell (CMD) in Windows Server 2008.
LVL 18

Expert Comment

by:Sarang Tinguria
ID: 39918658
Chris has a great GUI tool for all theese stuffs

Cjwdev | AD Info - Active Directory Reporting

Expert Comment

ID: 39919815
You could try this :

$Userlist = Get-QADUser -SearchRoot "OU=vhlusers,DC=vhl,DC=com"
$Report = @()
Foreach($user in $Userlist){
    $Userdata = Get-QADUser –Identity $user |
    Select FirstName, LastName, DisplayName, SAMAccountName, PhoneNumber, LastLogon
    $Report += $Userdata
$Report | Export-Csv –Path c:\UserReport.csv

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ADFS Help 7 48
Active Directory Account getting mysteriously locked 13 69
Monitoring solutions 8 72
Impact to changing AD username 2 22
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In-place Upgrading Dirsync to Azure AD Connect
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question