How to user DsQuery

Posted on Updated on


To find all the domain controllers in the forest with DN and RDN:

  • DsQuery Server -o rdn -Forest
  • DsQuery Server -Forest

To find all the domain controllers in a domain:

  • DsQuery Server -domain domain_name.com

To list all the domain controllers in a domain that are also Global Catalog Servers:

  • DsQuery Server -domain domain_name.com -isgc

To list the domain controller in the forest that holds the Schema FSMO:

  • DsQuery Server -Forest -hasfsmo schema

Note: Use the “>” to store the output to a text file. The below command will store all the domain controller names in AllDCs.txt.

  • DsQuery Server -Forest > AllDCs.txt
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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