Active Directory: Command line to get all subnets for a site

Hi,

this post describes the command line to get a list of all subnets for an Active Directory Site. The ds* commands are part of the Active Directory tools on Server and of RSAT Tools on Windows 7-10.

Search for a site

D:\> dsquery site -desc *mySite*

Or simple list all sites

D:\> dsquery site
...
"CN=mySite,CN=Sites,CN=Configuration,DC=mySubDomain,DC=Domain,DC=org"
...

Or get the sitename of your computer

D:\> nltest.exe  /DSGETSITE

And list all subnets

dsquery subnet -site "mySite"

Michael

Leave a Reply Cancel reply