Mark Telliers blog

May 24, 2007

DSQUERY Computer

Filed under: Scripting — Tags: — mtellier @ 11:34 am

DSQUERY is another simple command line utility for searching Active Directory. If it’s in AD, this tool can find it.

List the DN of all computer accounts:
dsquery computer

List all computers that have been inactive for the last 6 weeks:
dsquery computer -inactive 6

List all domain controllers:
dsquery server

List all computers within a specific OU:
dsquery computer ou=servers,dc=bigdog,dc=com

Refer to the DSQUERY Command Line Reference on Microsoft TechNet.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: