Solved

Export Active Directory Users

Posted on 2014-12-08
7
273 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
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.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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…
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 …

808 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