manage 8.1/2012R2/10/2016/2019/11/2022 user information 



userinfo [-b] [-estwn] [-D domain-name | -S hostname] [user-name...]

userinfo (-a|u) [-e] [-D domain-name | -S hostname] [-f fieldname:value ...] user-name...

userinfo -d [-e] [-D domain-name | -S hostname] user-name...


The userinfo command displays user information (for one or all users), adds or deletes users, and updates information associated with a user.

userinfo can take three forms:



adds a user. Each user-name given on the command line is added.


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.


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


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.


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.


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 system
                        has 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 log
                        onto the account.
PasswordCannotChange    Yes/No. Indicates that the user is permitted to change
                        their password.
PasswordDoesNotExpire   Yes/No. Indicates that the user's password doesn't expire.


PasswordDoesnotExpire takes precedence over PasswordExpired. If PasswordDoesnotExpire is set, 8.1/2012R2/10/2016/2019/11/2022 ignores whether or not PasswordExpired is set.

For a more complete description of these fields, consult the 8.1/2012R2/10/2016/2019/11/2022 administrative documentation.


restricts output to the normal user accounts.

-S hostname 

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.


sorts user list.


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.


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.


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


restricts output to the workstation trust accounts.


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.

if [ $# -ne 2 ]
    print Usage: adduser full-name employee-number >&2
    exit 1
# Create a user name with the first character of the first name; and
# the full last name.
set -- $fullname
uname=$(cut -b1 $1)

mkdir $homedir
chown $uname $homedir
chacl -g $uname:f $homedir
for sys in server1 server2 server3
    userinfo -S '\\'$sys -a \
        -f FullName:"$fullname" \
        -f HomeDir:$homedir \
        -f Password:$empno \
        -f Comment:"Employee #$empno" \
    member -u $uname -a accounting
echo User $uname created with home directory $homedir


Possible exit status values are:


Successful completion.


A usage error occurred.


A system error occurred.


Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


groupinfo, member

PTC MKS Toolkit 10.4 Documentation Build 39.