Link to home
Start Free TrialLog in
Avatar of NBquery
NBquery

asked on

Need tool to show PC object and what OU they reside in

I have 47 sites in AD with Workstaions OU's and their local computers of the site.  i.e. 'somecompay.com/Sites/sitename/Workstations./  I need a utility/tool that will output to CSV file every computer and the OU it sits in.  i.e  PC22-LA-08=somecompany/Sites/LA/Workstations/PC22-LA-08 etc.  I don't want a LDAP output.  Looking for one single CSV with 2500 or so PC's with column A having the PC name and column B showing the OU.

Not familiar at all with scripting, so hope there is an easier way to do this?  Anyone know of a tool or utility that can run through all 47 OU's to output this info?
SOLUTION
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or if you use the Quest Powershell Cmdlets here: http://www.quest.com/powershell/activeroles-server.aspx

You can just run the attached command. (Not exactly how you want it, since it includes the computer name in the OU output, but it should meet your needs)
get-qadcomputer | select computername,canonicalname | export-csv <filename>

Open in new window

Hi,

You can use also for that Quest PowerShell module for AD. It's completely free and can be downloaded from
http://www.quest.com/powershell/activeroles-server.aspx
 
then use this syntx to get required output
 
Get-QADComputer -name * -SizeLimit 0 | Select name,ParentContainerDN | Export-CSV c:\output.csv
 
You will get all computers in your domain with their name and OU to which they belong in CSV file
 
and also, Distinguished Name (DN) of an object contains both values in it. CN=<name> is a computer name and the rest OU=<location>,DC=<domain>,DC=<local> its location in OU within Active Directory
 
For that you can simply use DSQUERY command on a DC or workstation with installed Administrative Tools, use this structure
 
dsquery computer -name * -limit 0 >c:\output.txt

Regards,
Krzysztof
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NBquery
NBquery

ASKER

Thank you