Wednesday, 4 September 2013

Using DSQUERY to find a list of machines in your domain and output to a text file


List of projector machines!



I was recently asked to get a list of all machines attached to projectors within our organisation, fortunately we have an inteligent naming convention which includes the letters "proj" in any computername used with projector installs.

To accomplish this I used DSQUERY with the following parameters:

DSQUERY COMPUTER domainroot -o rdn -scope subtree -name *proj* -limit 1000 > c:\machines.txt

 This nicely outputted a textfile called machines in the root of my c: drive.

For more info on DSQUERY:

http://social.technet.microsoft.com/wiki/contents/articles/2195.active-directory-dsquery-commands.aspx
http://technet.microsoft.com/en-us/library/cc730720.aspx

Great when there's a quick solution!

No comments:

Post a Comment