Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ms:win:dsquery [2015/03/10 14:06] – angelegt jsms:win:dsquery [2023/04/28 09:05] (current) js
Line 1: Line 1:
-====== DSQuery ======+====== Dsquery ======
  
-  * search for domain controlers in actual tree/forest<code>dsquery server</code>+Homepage: [[https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc732952(v=ws.11)|Dsquery at Microsoft]]
  
-  * search in given domain forest<code>dsquery server -d <domain></code>+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.
  
-  * complete forest<code>dsquery server -forest</code>+ 
 +==== Search for domain controlers in actual tree/forest ==== 
 +<code bash>dsquery server</code> 
 + 
 +==== Search in given domain forest ==== 
 +<code bash>dsquery server -d <domain></code> 
 + 
 +==== Show complete forest ==== 
 +<code bash>dsquery server -forest</code> 
 + 
 +==== Show sites ==== 
 +<code bash>dsquery subnet -limit 0 | dsget subnet | select-string <sitename> </code> 
 +Example: 
 +<code bash>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 
 +</code>