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/site name/Works tations./ 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/Sit es/LA/Work stations/P C22-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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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>,
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
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)
Open in new window