?
Solved

Export Active Directory Users

Posted on 2014-12-08
7
Medium Priority
?
285 Views
Last Modified: 2014-12-10
Hello,
How can I bulk export many users from AD into a CSV file with these attributes?
first name, last name, login and email address.

Is there a program, tool or maybe powershell? How do I select the users needed?
Thanks.
0
Comment
Question by:tolinrome
[X]
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
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 1

Accepted Solution

by:
Ryan Rood earned 2000 total points
ID: 40488141
This is the script that I use to export users from PowerShell. I believe it includes all of the fields you require and has the formatting to export to excel. This dumps ALL users to excel and then I filter from there depending on what I am looking for.

# To Export
Get-ADUser -Filter {(Name -notlike "*(Administrator)")}  -Properties SamAccountName,GivenName,Surname,Description,DisplayName,Company,Department,Office,EmailAddress,OfficePhone,Mobile,Fax,StreetAddress,City,State,PostalCode,Country,LogonWorkstations,HomePage,Title,Manager,Enabled | Select-Object SamAccountName,GivenName,Surname,Description,DisplayName,Company,Department,Office,EmailAddress,OfficePhone,Mobile,Fax,StreetAddress,City,State,PostalCode,Country,LogonWorkstations,HomePage,Title,Manager,Enabled | export-csv -path c:\temp\ADUsersExported.csv -NoTypeInformation -Encoding "UTF8"
1
 
LVL 7

Author Comment

by:tolinrome
ID: 40488143
That seems pretty good. Ok, so just paste that above into a .PS1 file and run it from the Domain Controller?
0
 
LVL 1

Expert Comment

by:Ryan Rood
ID: 40488144
You can paste it right into PowerShell. I generally use the Active Directory Module for Windows PowerShell when wanting data from Active Directory.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 5

Expert Comment

by:Dilip Patidar
ID: 40488169
Hello,

Please refer the below URL. you can export the Users and Group in various format...

https://4sysops.com/archives/export-active-directory-users-with-powershell/

Thanks,
Dilip Patel
0
 
LVL 12

Expert Comment

by:Mahmoud Sabry
ID: 40488315
use the attached script
Export-Users-To-Excel.vbs
0
 
LVL 12

Expert Comment

by:Mahmoud Sabry
ID: 40488317
and u can select the fields you need from the excel file
0
 
LVL 7

Author Closing Comment

by:tolinrome
ID: 40492082
That worked great. Thanks.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 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