produces brief output. One line of output is displayed for each account; it
contains three tab delimited fields. The first is the account name, the second
the Full Name field, and the third the Comment field.

-d

deletes a user.
Each user-name given on the command line is deleted.

-Ddomain-name

locates the primary domain controller for the specified domain,
and requests that machine to perform the actions on behalf of the
userinfo command.
userinfo normally performs actions on the local system.

The -D and -S options are mutually exclusive.

-e

displays the error number contained in the errno variable for
any system error that occurs and exits.
You can use the strerror utility to display the system
error message corresponding to this error number.

-ffieldname:value

assigns a value to a specified fieldname
associated with users.
The following fieldnames are currently accepted:

FullName Full name of the user.
Password User's password.
Comment Comment associated with the user.
UserComment A second comment field.
HomeDirDrive Drive where home directory resides.
HomeDir Directory for user's home.
Profile User Profile File.
LogonScript User Logon Script name.
AccountDisable Yes/No. Disables or enables the user's account.
Lockout No. Clears the account lockout flag if the security systemhas locked it out.
PasswordExpired Yes/No. Indicates that the user's password has expired.
PasswordNotRequired Yes/No. Indicates that a password is not required to logonto the account.
PasswordCannotChange Yes/No. Indicates that the user is permitted to changetheir password.
PasswordDoesNotExpire Yes/No. Indicates that the user's password doesn't expire.

Note:

PasswordDoesnotExpire takes precedence over
PasswordExpired. If PasswordDoesnotExpire is set,
7/2008R2/8/2012/10/2016 ignores whether or not PasswordExpired is set.

For a more complete description of these fields, consult the
7/2008R2/8/2012/10/2016 administrative documentation.

-n

restricts output to the normal user accounts.

-Shostname

specifies the host machine that the userinfo command
requests to perform actions on its behalf.
userinfo normally performs actions on the local system.
Optionally, hostname may be preceded by \\ or
//.

The -D and -S options are mutually exclusive.

-s

sorts user list.

Note:

When using the -s option with the -b
option to produce a sorted brief list of users, the list is actually
generated faster than just using the -b option.

-t

restricts output to the server and interdomain trust accounts.

If none of -n, -w, or -t
options are given, userinfo behaves as if all three
were specified.
If any -f options are given, they apply to all users added.

-u

updates a user.
Each user-name given on the command line has one or
more fields (specified with the -f option) updated.

You can use the script described here to automatically create user names on
multiple machines, conforming to local policy.
A sample invocation of this script looks like

adduser "John Doe" 123

This example is very minimized. Logon scripts could be copied,
a mandatory profile copied to a central profile directory,
permissions given for various other directories, and so on.
The caller must have administrator privileges.