Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Active Directory - Powershell Command

Posted on 2015-02-09
5
Medium Priority
?
15 Views
Last Modified: 2016-06-23
Hi,

Can you please let me know how i can get the following information from Active Directory into excel using powershell command.

Specific OU container e.g. test.loc, UK, Office 1, Users
Display Name
Title
Department
Company
Street Address
City
Postal Code
Country or Region
Phone
Manager
Mobile

thanks
0
Comment
Question by:MVTechies
[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
5 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 40598563
Use the following powershell command below...

import-module activedirectory
get-aduser -filter * -properties * | select DistinguishedName, Name, Title, Department, Company, StreetAddress, City, PostalCode, Country, OfficePhone, Manager, MobilePhone | export-csv "c:\users.csv" -notypeinformation

Open in new window


Will.
0
 

Author Comment

by:MVTechies
ID: 40598579
thanks Will,

How can i drill this down to only a specific container? We have multiple OU's and i only need this for a couple of specific groups.

thanks
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 2000 total points
ID: 40598594
Just use the code below. I have added the additional syntax.

import-module activedirectory
get-aduser -filter * -SearchBase "ou=mfg,dc=domain,dc=com" -properties * | select DistinguishedName, Name, Title, Department, Company, StreetAddress, City, PostalCode, Country, OfficePhone, Manager, MobilePhone | export-csv "c:\users.csv" -notypeinformation

Open in new window


I have added the line "ou=mfg,dc=domain,dc=com" you need to change this to the OU and domain that you are running this under.

Let me know if you need any help with this.

Will.
0
 

Author Comment

by:MVTechies
ID: 40598620
thanks Will.

Much appreciate the quick response.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

688 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