Solved

Export Active Directory Users

Posted on 2014-12-08
7
272 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
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 1

Accepted Solution

by:
Ryan Rood earned 500 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

803 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