Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: wntUserGetDat wntUserAddDat wxxUserSetDat wxxUserGetDat
I want to use the wntUserGetDat function to get a list of the users who's account is disabled, or no password is required, etc. for audit purposes.
What is the syntax usage for the "flags" element.
user="joe" flags=wntUserGetDat("\\SERVER",user,"flags") if flags & 2 Message(user,"Account Disabled") endif if flags & 32 Message(user,"Password not required") endif
I want to be able use "Admin" rights to set information in the users account, even though the logged on user does not have those rights. Or any work around ideas....?
I have used wntUserSetDat with success in the past to automate account updates when Home directories, user profiles, login scripts and/or profiles are changed. For some reason I can't seem to rename an existing NT user account?
The syntax is:
wntUserSetDat("\\%PDC%",Old_Username,"name",New_Username)The command seems to process without any errors, but when completed, the username stays exactly the same..
This is true. wntUserSetDat cannot rename an account. See the Win32 Network Extender function wntUserRename.
If I perform a wntUserGetDat() on the flags for a normal account with none of the flags checked in User Manager I end up with a result of 513, which is 512 (Normal User) plus 1 (bit 0).
Does anybody have an idea as to what this bit is supposed to do when enabled?
rc=wntusersetdat(usermachine,"userid","flags",2)I'm using WinBatch 32 97D
Any idea's?
Try something like:
myflags=wntusergetdat(usermachine,"userid","flags") myflags=myflags | 2 rc=wntusersetdat(usermachine,"userid","flags",myflags)Alternatively, all you need to do to make it work is to add a 1 to the value of the flags that you are setting.
Ex:
wntUserAddDat("flags",512+1) ;Normal Account
AddExtender("WWWNT32I.DLL") wntUserSetDat("\\server","user","flags",2)The above syntax creates an error message "error 531 invalid parameter". I've tried a lot of variations on this and the help file doesn't seem to clarify what the correct syntax might be. Can someone point out the error of my ways?
flags=wntUserGetDat("\\server","jdoe","flags") theflags=flags|2 wntUserSetDat("\\server","jdoe","flags",theflags)to preserve the value of the other flags. Just the 2 flag by itself may be illegal.
To get the flag settings for the current user:
flags = w9XUserGetDat("\\MYSERVER", "jdoe", "flags")Unset the bit with:
flags = flags & ~16 w9XUserSetDat("\\MYSERVER", "jdoe", "flags", flags)~ is the bitwise NOT operator.
I would like (if possible) to have the "User must Change Password at Next Logon" (a checkbox option in User Manager) added to the list of optional flags for this function
Article ID: W13585
Filename: wNTUserXXXDat Function and Flags.txt
File Created: 2001:03:01:14:24:18
Last Updated: 2001:03:01:14:24:18