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


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

Or get the sitename of your computer

D:\> nltest.exe  /DSGETSITE

And list all subnets

dsquery subnet -site "mySite"


Advertisment to support

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.