Homepage: Dsquery at Microsoft
Dsquery is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsquery, you must run the dsquery command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.
dsquery server
dsquery server -d <domain>
dsquery server -forest
dsquery subnet -limit 0 | dsget subnet | select-string <sitename>
Example:
dsquery subnet -limit 0 | dsget subnet | select-string SITE2 CN=172.16.1.0/24,CN=Subnets,CN=Sites,CN=Configuration,DC=ad,DC=lab,DC=de Stuttgart SITE2 CN=172.16.2.0/24,CN=Subnets,CN=Sites,CN=Configuration,DC=ad,DC=lab,DC=de Huenfeld SITE2 CN=172.16.3.0/24,CN=Subnets,CN=Sites,CN=Configuration,DC=ad,DC=lab,DC=de Kerry SITE2