C:\users\domainadmin>dsmod user Zhang.san/?
Description: Modifies an existing user in the directory.
Syntax: dsmod user <userdn ...> [-upn <upn>] [-FN <firstname>]
[-mi <initial>] [-ln <lastname>] [-display <displayname>]
[-FNP <first name Phonetic>] [-LNP <last name Phonetic>]
[-DISPLAYP <display name Phonetic>]
[-empid <employeeid>] [-pwd {<password> | *}]
[-desc <description>] [-office <office>] [-tel <phone#>]
[-email <email>] [-hometel [-mobile <cellphone#>] [-fax <fax#>] [-iptel <ipphone#>]
[-WEBPG <webpage>] [-title <title>] [-dept <department>]
[-company <company>] [-mgr <manager>] [-hmdir [-hmdrv <driveltr>:] [-profile <profilepath>]
[-loscr <scriptpath>] [-mustchpwd {yes | no}]
[-canchpwd {yes | no}] [-reversiblepwd {yes | no}]
[-pwdneverexpires {yes | no}]
[-acctexpires <numdays>] [-disabled {yes | no}]
[{-S <Server> |-D <domain>}] [-u <username>]
[-P {<password> | *}] [-c] [-Q] [{-UC |-uco |-uci}]
Parameters:
Value Description
<userdn ...> requires an item/stdin. The distinguished name of one or more users to modify
Name (DN). If the target object is omitted, it is entered from the standard input (stdin)
To support the output of another command through the pipeline as a
Input to the order.
-UPN <UPN> Set the UPN value to <UPN>.
-FN <FirstName> Set the user's name to <FirstName>.
-mi <Initial> Set the user's middle initials to <Initial>.
-ln <LastName> Set the user's last name is <LastName>.
-display <DisplayName> Set the user display name to <DisplayName>.
-FNP <FirstNamePhonetic>
Set the user pinyin name to <FirstNamePhonetic>.
-LNP <LastNamePhonetic> set user Pinyin surname is <LastNamePhonetic>.
-DISPLAYP <DisplayNamePhonetic>
Sets the user phonetic display name <DisplayNamePhonetic>.
-empid <EmployeeID> Set user employee ID to <EmployeeID>.
-pwd {<password> | *} resets the user password to <Password>. If it is *, you will be prompted
You enter a password.
-desc <Description> Set the user's description as <Description>.
-office <Office> Set the user's office location to <Office>.
-tel <Phone#> Set the user's phone number to <Phone#>.
-email <Email> Set the user's e-mail address to <Email>.
-hometel <HomePhone#> Set the user's home phone number to <HomePhone#>.
-pager <Pager#> Set the user's pager number to <Pager#>.
-mobile <CellPhone#> Set the user's portable phone number to <CellPhone#>.
-fax <Fax#> Set the user's fax number to <Fax#>.
-iptel <IPPhone#> Set the user's IP phone number to <IPPhone#>.
-WEBPG <WebPage> Set user page URL to <WebPage>.
-title <Title> Set the title of the user to <Title>.
-dept <Department> Set the user's department to <Department>.
-company <Company> Set the user's company information to <Company>.
-mgr <Manager> Set the user's manager to <Manager>.
-hmdir <HomeDir> Set the user's home directory to <HomeDir>. If it is a UNC path, the
The drive letter that will be mapped to this path must be specified through-hmdrv.
-hmdrv <driveltr>: Set user Master drive letter to <driveltr>:
-profile <ProfilePath> Set User profile path to <ProfilePath>.
-LOSCR <ScriptPath> Set user logon script path to <ScriptPath>.
-mustchpwd {yes | no} Sets the user to be (yes) no (no) must change the password at the next logon.
-canchpwd {yes | no} Sets whether the user is (yes) no (no) can change the password. If-mustchpwd
setting is "yes", this setting should also be "yes".
-reversiblepwd {yes | no}
Set Yes (yes) no (no) to store user passwords using reversible encryption.
-pwdneverexpires {yes | no}
The Set user password is (yes) no (NO) never expires.
-acctexpires <NumDays> Set the user account to expire from today <NumDays> days after. Value is 0 table
Account expires at the end of today. The positive value setting expires in the future. Negative setting
Expired in the past. The string value "Never" indicates that this account will never expire.
-disabled {yes | no} setting Yes (yes) no (NO) disables user accounts.
{-S <Server> |-D <domain>}
-S <Server> connect to a name <Server>
AD Dc/lds instance.
-D <Domain> Connect to AD DC in domain <Domain>.
Default: One of the AD DCs in the logon domain.
-U <UserName> with <UserName> connection. Default: Logged in user.
The user name can be: User name, domain \ user name, or user principal name (UPN).
-P <Password> user <UserName> password. If it is *, you are prompted to enter the password.
-C Continuous Operation mode: If more than one target object is specified, an error is reported
After you continue processing the next object of the parameter list. If you do not have this option,
The command exits when the first error occurs.
-Q Quiet mode: Suppresses all outputs to standard output.
{-UC |-uco |-uci}-UC Specifies the input from the pipeline or the output to the pipeline in Unicode format.
-UCO specifies that the output to the pipe or file is in Unicode format.
-UCI specifies that the input from the pipe or file is in Unicode format.
Note:
If you provide a value that contains spaces, use quotation marks around the text
(For example, "Cn=john smith,cn=users,dc=microsoft,dc=com").
If you enter more than one value, these values must be separated by a space
(for example, a series of distinguished names).
Special tokens $username $ (case insensitive) can be used to
SAM account names are placed in-WEBPG,-profile,-hmdir, and
The value of the-email parameter.
For example, if the target user DN is
Cn=jane Doe,cn=users,cn=microsoft,cn=com,sam
The Account Name property is "Janed", the-hmdir parameter can be the following
Replacement value:
-hmdir \users\ $username $\home
The-hmdir parameter value can be modified to the following values:
-Hmdir \users\janed\home
Example:
Reset User password:
dsmod user "Cn=john doe,cn=users,dc=microsoft,dc=com"
-pwd A1b2c3d4-mustchpwd Yes
To reset multiple user passwords to public passwords
and force them to change their password at the next logon:
dsmod user "Cn=john doe,cn=users,dc=microsoft,dc=com"
"Cn=jane doe,cn=users,dc=microsoft,dc=com"-pwd a1b2c3d4-mustchpwd Yes
To disable multiple user accounts at the same time:
dsmod user "Cn=john doe,cn=users,dc=microsoft,dc=com"
"Cn=jane doe,cn=users,dc=microsoft,dc=com"-disabled Yes
Use the $username $ token to change the profile path for multiple users to
Common path:
dsmod user "Cn=john doe,cn=users,dc=microsoft,dc=com"
"Cn=jane doe,cn=users,dc=microsoft,dc=com"-profile \users\ $username $\profile
Please see also:
dsmod computer/? -Help for modifying existing computers in the directory.
dsmod contact/? -Modify the Help for existing contacts in the directory.
dsmod group/? -Help for modifying existing groups in the directory.
dsmod ou/? -Modify the Help for an existing organizational unit in the directory.
dsmod server/? -Help for modifying an existing AD Dc/lds instance in the directory.
dsmod user/? -Modify the help of existing users in the directory.
dsmod quota/? -Help to modify existing quota provisions in the directory
dsmod partition/? -Help for modifying existing partitions in the directory
Directory Services command-line tools Help:
dsadd/? -Help for adding objects.
dsget/? -Displays Help for the object.
dsmod/? -Help for modifying objects.
dsmove/? -Help for moving objects.
dsquery/? -Find help for objects that match your search criteria.
DSRM/? -Help for deleting objects.
C:\users\domainadmin>
AD domain Controller dsmod modify command