[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Script to export all computers in an OU and Sub-OUs into text file

Posted on 2008-11-12
5
Medium Priority
?
1,014 Views
Last Modified: 2012-05-05
Hello Everyone!

I am wondering if it is possible to have a script that exports a list of all computers in an OU and any sub OUs into a text file and have each computer name on a separate line. I do not have the faintest idea on where to begin so any help would be great!

Thanks!
0
Comment
Question by:Joseph Moody
  • 2
  • 2
5 Comments
 
LVL 20

Expert Comment

by:mkbean
ID: 22940089
Have you tried just right clicking on the OU and selecting Export List...?  You then can do a CTRL H and find Computer and leave Replace blank to remove it.  That should work for you.

Thanks,
Brian
0
 
LVL 22

Author Comment

by:Joseph Moody
ID: 22940920
Does that grab any computers in sub OUs?
0
 
LVL 20

Accepted Solution

by:
mkbean earned 2000 total points
ID: 22940982
No it will not.  But I did just find this similar post that may help you.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_22494511.html

Brian
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22941499
Download and install the Server Resource Kit and use DSQUERY

dsquery computer -o rdn -limit 0 "cn=computers,dc=vch,dc=ca">Machines.txt
0
 
LVL 22

Author Closing Comment

by:Joseph Moody
ID: 31515952
That worked perfect (used the vbs solution)! Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Let's recap what we learned from yesterday's Skyport Systems webinar.
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
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 …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

834 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