JSI Tip 8198. When you run the 'dsquery server -hasfsmo infr' command in Windows Server 2003, it returns the PDC emulator role holder instead of the Infrastructure Master role holder?

When you use the dsquery server -hasfsmo infr command, in Windows Server 2003, to display the Infrastructure Master FSMO (Flexible Single Master Operations ) role holder, it returns the PDC Emulator role holder.

To workaround this problem behavior, use the following command instead:

Dumpfsmos <NetBIOS Domain Controller Name>

NOTE: See Another way to test if a domain controller is a Global Catalog server?

NOTE: The DSQUERY SERVER /? command returns:

Description: Finds domain controllers according to specified search criteria.

Syntax:     dsquery server \[-o \{dn | rdn\}\] \[-forest\]
            \[-domain \] \[-site \]
            \[-name \] \[-desc \]
            \[-hasfsmo \{schema | name | infr | pdc | rid\}\] \[-isgc\]
            \[\{-s  | -d \}\] \[-u \]
            \[-p \{ | *\}\] \[-q\] \[-r\] \[-gc\]
            \[-limit \] \[\{-uc | -uco | -uci\}\]

Value                   Description
-o \{dn | rdn\}           Specifies output format.
                        Default: distinguished name (DN).
-forest                 Finds all domain controllers (DCs) in the current
-domain     Finds all DCs in the domain with a DNS name
                        matching .
-site         Finds all DCs that are part of site .
-name             Finds DCs with names matching the value given
                        by , e.g., "NA*" or "Europe*" or "j*th".
-desc      Finds DCs with descriptions matching the value
                        given by , e.g., "corp*" or "j*th".
-hasfsmo \{schema | name | infr | pdc | rid\}
                        Finds the DC that holds the specified
                        Flexible Single-master Operation (FSMO) role.
                        (For the "infr," "pdc" and "rid" FSMO roles,
                        if no domain is specified with the -domain
                        parameter, the current domain is used.)
-isgc                   Find all DCs that are also global
                        catalog servers (GCs) in the scope specified
                        (if the -forest, -domain or -site parameters
                        are not specified, then find all GCs in the current
                        domain are used).
\{-s  | -d \}
                        -s  connects to the domain controller (DC)
                        with name .
                        -d  connects to a DC in domain .
                        Default: a DC in the logon domain.
-u            Connect as . Default: the logged in
                        user. User name can be: user name,
                        domain\user name, or user principal name (UPN).
-p            Password for the user .
                        If * then prompt for password.
-q                      Quiet mode: suppress all output to standard output.
-r                      Recurse or follow referrals during search.
                        Default: do not chase referrals during search.
-gc                     Search in the Active Directory global catalog.
-limit      Specifies the number of objects matching the given
                        criteria to be returned, where  is the
                        number of objects to be returned. If the value of
                         is 0, all matching objects are returned.
                        If this parameter is not specified,
                        by default the first 100 results are displayed.
\{-uc | -uco | -uci\}     -uc Specifies that input from or output to pipe is
                        formatted in Unicode.
                        -uco Specifies that output to pipe or file is
                        formatted in Unicode.
                        -uci Specifies that input from pipe or file is
                        formatted in Unicode.

The dsquery commands help you find objects in the directory that match
a specified search criterion: the input to dsquery is a search criteria
and the output is a list of objects matching the search. To get the
properties of a specific object, use the dsget commands (dsget /?).

If a value that you supply contains spaces, use quotation marks
around the text (for example, "CN=John Smith,CN=Users,DC=microsoft,DC=com").
If you enter multiple values, the values must be separated by spaces
(for example, a list of distinguished names).

To find all DCs in the current domain:

    dsquery server

To find all DCs in the forest and display their
Relative Distinguished Names:

    dsquery server -o rdn -forest

To find all DCs in the site whose name is "Latin-America", and display their
Relative Distinguished Names:

    dsquery server -o rdn -site Latin-America

Find the DC in the forest that holds the schema FSMO role:

    dsquery server -forest -hasfsmo schema

Find all DCs in the domain example.microsoft.com that are
global catalog servers:

    dsquery server -domain example.microsoft.com -isgc

Find all DCs in the current domain that hold a copy of a given directory
partition called "ApplicationSales":

    dsquery server -part "Application*"
See also:
dsquery computer /? - help for finding computers in the directory.
dsquery contact /? - help for finding contacts in the directory.
dsquery subnet /? - help for finding subnets in the directory.
dsquery group /? - help for finding groups in the directory.
dsquery ou /? - help for finding organizational units in the directory.
dsquery site /? - help for finding sites in the directory.
dsquery server /? - help for finding servers in the directory.
dsquery user /? - help for finding users in the directory.
dsquery quota /? - help for finding quotas in the directory.
dsquery partition /? - help for finding partitions in the directory.
dsquery * /? - help for finding any object in the directory by using a
generic LDAP query.

Directory Service command-line tools help:
dsadd /? - help for adding objects.
dsget /? - help for displaying objects.
dsmod /? - help for modifying objects.
dsmove /? - help for moving objects.
dsquery /? - help for finding objects matching search criteria.
dsrm /? - help for deleting objects.
dsquery failed:The parameter is incorrect.
type dsquery /? for help.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.