wntAcctList

Rapidly lists accounts on an NT/2K/XP system.

Syntax:

wntAcctList( server-name , request [, output-format-flag] )

Parameters:

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

(i) request: specifies the types of 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 account names.

 

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

 

"request" specifies the types of accounts to return in a delimited list. You can specify 0 to include all account types, or specify one or more of the following flags, combined using the bitwise OR ('|') operator:

 

Request

Meaning

1

Return user accounts. The results are similar to using wntUserList() with an account type of "2".

 

2

Return machine accounts. The results are similar to using wntUserList() with an account type of "48" [16 | 32]. Please note that inter-domain trust accounts cannot be returned with wntAcctList(), although they can be returned with wntUserList().

 

3

Return group accounts. The results are similar to using wntListGroups() with a @GLOBALGROUP group type. Please note that local groups cannot be returned with wntAcctList(), although they can be returned with wntListGroups().

 

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

 

Flag

Meaning

0

(default) Return actual account name.

 

 

1

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

 

2

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

 

4

SID values will be returned in place of account names.

 

32

Display a progress dialog when obtaining a large list of accounts. 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 an account name. The additional information will appear as pipe "|" delimited fields in a record, with each record in the list delimited by a TAB character.

 

In the case of a user account, the record format would be:

 

"user|comment|full_name|flags|RID"

 

In the case of a machine account, the record format would be:

 

"machine|comment|flags|RID"

 

In the case of a [global] group account, the record format would be:

 

"group|comment|RID"

 

The flags are the account flags. Refer to wntUserGetDat() for information regarding the various flag bits and their meanings.

 

The RID is the Relative Identifier for the account, and it uniquely identifies the account within the domain in which the account is located. The RID appears as the very last component in the account's SID vaue.

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

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

wntUserList, wntListGroups