Solved

Export Active Directory Users

Posted on 2014-12-08
7
268 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now