• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

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?
2 Solutions
Adam BrownSr Solutions ArchitectCommented:
LDFDE is a command line utility that can do this for you. http://support.microsoft.com/kb/237677 has info on the syntax. Give me a minute and I can give you a direct command to use.
Adam BrownSr Solutions ArchitectCommented:
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

Krzysztof PytkoActive Directory EngineerCommented:

You can use also for that Quest PowerShell module for AD. It's completely free and can be downloaded from
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


Refer this,  script searches Active Directory and report information about computer objects by santosh sivarajan. the script has two outputs one of them is creates an output file called ComptuerInfo.csv which contains all computer information.


You can use simple OldCmp Command line Active Directory query tool.
Please visit http://www.joeware.net/freetools/tools/oldcmp/index.htm to download OldCmp.

It generates a file called oldcmp_export.csv of all the systems in the domain within the hosting OU with their last system login time if available.

Refer this blog for more info: http://desktopdude.blogspot.com/2011/01/export-computer-objects-from-active.html
NBqueryAuthor Commented:
Thank you

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now