wntUserList

Lists users with accounts on an NT server.

Syntax:

wntUserList( server-name, account-type [, output-format-flag])

Parameters:

(s) server-name: the UNC name of the server on which the function will execute (eg, "\\MYSERVER"), or "" for the local computer.

(i) account-type: specifies the types of user accounts to include. (see below)

(i) output-format-flag: [optional] controls the format of the user names that are returned. See below.

Returns:

(s) Returns a tab-delimited list of user names.

 

Note: to list users in a domain, specify a domain controller for that domain as "server-name".

 

"account-type" specifies the types of user accounts to include. You can specify 0 to include all account types, or specify one or more of the following flags, combined using the bitwise OR ('|') operator:

 

Flag

Meaning

0

All account types. 

1

 Include local user account data on a domain controller. 

2

Include global user account data on a computer. 

8

Include domain trust account data on a domain controller. 

16

Include workstation or member server account data on a domain controller.

32

 Include domain controller account data on a domain controller.

 

 

"output-format-flag" [optional parameter] controls the format of the user names that are returned.

Flag

Meaning

0

(default) actual user account name.

1

user names will have domain names prefixed on to them, except in cases where the domain name is "BUILTIN" or "NT AUTHORITY".

2

user names will have domain names prefixed on to them in all cases.

4

SID values will be returned in place of user names.

32

display a progress dialog when obtaining a large list of users. This allows the script to show its continuing progress even though the extender function has not yet returned control to the script.

64

force a 1 second delay between updates to the progress dialog box. Note: this flag slows down the processing to be able to see what was going on in the progress dialog

256

allows extended information to be returned along with a user name. In the case of a user account, the pipe "|" delimited records in the TAB delimited list will consist of the account name, full name, comment and user comment. An example of the format would be

"user1|full_name1|comment1|usr_comment1<TAB>user2|full_name2|comment2|usr_comment2".


This flag is intended to allow more user friendly lists of user information to be obtained without having to resort to using multiple functions (e.g. wntUserList & wntUserGetDat) in nested loops to gather this same information. Instead, a single extender function gathers all of the information at once and then the script can split the resulting data into separate lists or even populate an array with the information.

 

Example:

; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

users = wntUserList("",0,1) AskItemlist("List of users with accounts on an NT server.", users,@TAB,@SORTED,@SINGLE) Exit
See Also:

wntAcctList, wntUserInfo