NT_GetUserName

NT_GetUserName returns the name of the user in whose context the script is running.

NT_UserChangePassword ?domainName? username oldPassword newPassword

NT_UserChangePassword will return the empty set if successful. On failure, it will cause an error and return an error string.

NT_UserGetInfo ?serverName? username

NT_UserGetInfo returns a list of the following items:

username

full name

comment

user flags

user parameters

authorization flags

privilege

password age

bad password count

password expired

home directory

home directory drive

profile

logon script path

last logon

last logoff

account expiration

number of logons

logon server

country code

code page

user id

primary group id

user comment

workstations

max storage

units per week

NT_UserSetInfo ?serverName? userName property value

NT_UserSetInfo allows you to set these user account parameters:

password

priv

home_dir

comment

flags

script_path

auth_flags

full_name

usr_comment

parms

workstations

acct_expires

max_storage

logon_server

country_code

code_page

primary_group_id

profile

home_dir_drive

NT_UserDel ?serverName? userName

NT_UserDel returns nothing if successful, and causes and error and returns an error string on error.

NT_UserAdd ?serverName? templateAccount username password homeDirectory comment script fullName

NT_UserAdd creates an account using the template account as the default for many parameters. You should use the template account to specifiy general defaults (like logon hours), and that cannot currently be set with NT_UserSetInfo.

NT_UserEnum ?serverName? filter

Example

NT_UserEnum returns a list of all user accounts on the specified server. filter may be specified as the empty string, in which case in returns normal user accounts. Specifying the empty string ({}) will filter for normal user accounts.

Filter strings (joined by the verticle bar "|'):

FILTER_TEMP_DUPLICATE_ACCOUNT

FILTER_NORMAL_ACCOUNT

FILTER_PROXY_ACCOUNT*

FILTER_INTERDOMAIN_TRUST_ACCOUNT

FILTER_WORKSTATION_TRUST_ACCOUNT

FILTER_SERVER_TRUST_ACCOUNT

*FILTER_PROXY_ACCOUNT is commented out in the SDK header files, so use it at your own risk.

FILTER_INTERDOMAIN_TRUST_ACCOUNT will return list of all trusted domains, like this (note the $ is not part of the domain name, NT uses it to hide the account):

{{DOMAIN1$} {} {}} {{DOMAIN2$} {} {}}

FILTER_WORKSTATION_TRUST_ACCOUNT will return a list of all workstations and non-PDC/BDC servers in your domain, like this (note the $ is not part of the domain name, NT uses it to hide the account):

{{Machine 1$} {} {}} {{Machine 2$} {} {}}

FILTER_SERVER_TRUST_ACCOUNT will return a list of all PDCs and BDCs in the domain, like this (note the $ is not part of the domain name, NT uses it to hide the account):

{{Server1$} {} {}} {{Server 2$} {} {}}

FILTER_NORMAL_ACCOUNT will return a list of all the users:

{{jdoe} {Jane Doe} {Who is she, anyway?}} {{jsmith} {John Smith} {a normal user}} {{administrator} {} {Built-in account for administering the 
computer/domain}}

Each account entry returned is a list of three items:

username

fullName

Comment