DSGET Subnet (installable option via RSAT /AD DS)

Display subnet(s) from active directory.

      DSGET Subnet SubnetDN [-dn] [-desc] [-loc] [-site]
         [{-s Server | -d Domain}] [-u UserName] [-p {Password | *}]
            [-c] [-q] [-l] [{-uc | -uco | -uci}]

  SubnetDN  Distinguished Name of the subnet to view.

   -dn      Display the Distinguished Names of the subnets. 
   -desc    Display the descriptions of the subnets.
   -loc     Display the subnet locations.
   -site    Display the site names associated with the subnets.

   -s       Server to connect to (Default=the domain controller in the logon domain.)
   -d       Domain to connect to

   -u       Username with which the user logs on to a remote server. 
   -p       Password     (UserName or Domain\UserName or Username@domain.com)

   -c       Report errors, but continue with the next object after any error (when you specify multiple objects)
            by default dsget will exit when the first error occurs.

   -q       Quiet, suppress all output
   -l       Display entries in a list format. By default, dsget outputs a table format.

   -uc      Unicode format
   -uco     Unicode format for output only
   -uci     Unicode format for input only

Dsget can accept stdin from the keyboard, from a redirected file, or as piped output from another command e.g. DSQuery


Display properties for the subnets 10.55.130.*

C:\> dsquery subnet -name 10.55.130.*

C:\>dsget subnet "CN=,CN=Subnets,CN=Sites,CN=Configuration,DC=example,DC=com"
   dn                                                                        desc       site
   CN=,CN=Subnets,CN=Sites,CN=Configuration,DC=example,DC=com  EXAMPLECR  EXAMPLE-MSY
 dsget succeeded

The output from DSQuery can be piped directly to DSGet:

C:\> dsquery subnet -name 10.55.130.* | dsget subnet -site
 dsget succeeded

“All day long the door of the sub-conscious remains just ajar; we slip through to the other side, and return again, as easily and secretly as a cat” ~ Walter de La Mare

Related commands:

DSAdd - Add object.
DSMod - Modify object.
DSGet - Display object.
DSMove - Move object.
DSQuery - Search for objects.
DSRM - Delete object.

Copyright © 1999-2021 SS64.com
Some rights reserved