Saturday, November 5, 2011

Parameters for the dsquery user command


Parameters
{StartNode | forestroot | domainroot}

Specifies the node where the search will start. You can specify the forest root (forestroot), domain root (domainroot), or a node’s distinguished name (StartNode). If forestroot is specified, the search is done using the global catalog. The default value is domainroot.


-o {dn | rdn | upn | samid}
Specifies the format in which the list of entries found by the search will be displayed. A dn value displays the distinguished name of each entry. A rdn value displays the relative distinguished name of each entry. A upn value displays the user principal name of each entry. A samid value displays the SAM account name of each entry. By default, the dn format is used.

-scope {subtree | onelevel | base}
Specifies the scope of the search. A value of subtree indicates that the scope is a subtree rooted at start node. A value of onelevel indicates the immediate children of start node only. A value of base indicates the single object represented by start node. If forestroot is specified as StartNode, subtree is the only valid scope. By default, the subtree search scope is used.

-name Name
Searches for users whose name attributes (value of CN attribute) matches Name. For example, "jon*" or "*ith" or "j*th".

-desc Description
Searches for users whose description attribute matches Description. For example, "jon*" or "*ith" or "j*th".

-upn UPN
Searches for users whose UPN attribute matches UPN.

-samid SAMName
Searches for users whose SAM account name matches SAMName.

-inactive NumberOfWeeks
Searches for to find all users that have been inactive (stale) for at least the specified number of weeks.

-stalepwd NumberOfDays
Searches for all users that have not changed their password for at least the specified number of days.

-disabled
Searches for all users whose accounts are disabled.

{-s Server | -d Domain}
Connects to a specified remote server or domain. By default, the computer is connected to the domain controller in the logon domain.

-u UserName
Specifies the user name with which the user logs on to a remote server. By default, -u uses the user name with which the user logged on. You can use any of the following formats to specify a user name:
user name (for example, Linda)
domain\user name (for example, widgets\Linda)
user principal name (UPN) (for example, Linda@widgets.microsoft.com)

-p {Password | *}
Specifies to use either a password or a * to log on to a remote server. If you type *, you are prompted for a password.

-q
Suppresses all output to standard output (quiet mode).

-r
Specifies that the search use recursion or follow referrals during search. By default, the search will not follow referrals during search.

-gc
Specifies that the search use the Active Directory global catalog.

-limit NumberOfObjects
Specifies the number of objects that match the given criteria to be returned. If the value of NumberOfObjects is 0, all matching objects are returned. If this parameter is not specified, by default the first 100 results are displayed.

{-uc | -uco | -uci}
Specifies that output or input data is formatted in Unicode. The following table lists and describes each format. Value Description
-uc Specifies a Unicode format for input from or output to a pipe (|).
-uco Specifies a Unicode format for output to a pipe (|) or a file.
-uci Specifies a Unicode format for input from a pipe (|) or a file.

No comments:

Post a Comment