WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntAcctList Returns Incorrect Flag Values


Question:

The flag values returned from wntacctlist('',1,2|256) do not have the 64 bit flag included "User Cannot Change Password"

For example wntacctlist() returns flag of 8389155 when wntusergetdat('',sid,'flags',1) returns 8389219 for same user.

Using version 39020.0.0.1 of the wwwnt34i.dll

AddExtender("WWWNT34I.DLL")
useraccts = 1
extendedinfo = 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"
acct_list = wntacctlist( '', useraccts, extendedinfo )
userinfo = AskItemlist("User Accounts", acct_list,@TAB,@SORTED,@SINGLE)
username = ItemExtract( 1, userinfo, "|" )
flags1 = ItemExtract( 4, userinfo, "|" )
flags2 = wntusergetdat('',username,'flags',0)
Pause('Results', 'wntacctlist returned: ' : flags1 : @crlf : 'wntusergetdat returned: ' : flags2) 

Answer:

It would appear that the Win32 API function NetQueryDisplayInformation() has a bug in it, if it's omitting that particular flag bit from the results. The extender function wntAcctList() makes exclusive use of this function to rapidly enumerate accounts in a domain, which is done differently from how wntUserList() obtains its information. However, if the flag bit is missing from the results, there's not much that can be done other than to call wntUserGetDat() to ensure that the complete flags bit mask is obtained when that particular flag bit is of importance.

The extender's help file should probably be updated to indicate that this particular flag bit is not being retrieved by wntAcctList() due to this bug in the Win32 API function that it uses to obtain its information.


Article ID:   W18001
Filename:   wntAcctList Returns Incorrect Flag Values.txt
File Created: 2008:08:18:12:04:30
Last Updated: 2008:08:18:12:04:30