userinfo

manage 7/2008R2/8/2012/10/2016 user information 

Command


SYNOPSIS

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...


DESCRIPTION

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:

Options

-a 

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

-b 

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 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.

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.

-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.

-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.

-w 

restricts output to the workstation trust accounts.


EXAMPLES

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 ]
then
    print Usage: adduser full-name employee-number >&2
    exit 1
fi
empno=$2
#
# Create a user name with the first character of the first name; and
# the full last name.
#
fullname=$1
set -- $fullname
uname=$(cut -b1 $1)
shift
uname="$uname$*"
homedir=//server1/homedirs/$uname

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

DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

A usage error occurred.

3 

A system error occurred.


PORTABILITY

Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016.


AVAILABILITY

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


SEE ALSO

Commands:
groupinfo, member


PTC MKS Toolkit 10.1 Documentation Build 15.