wntUserAdd

Adds a user account.

Syntax:

wntUserAdd(server-name)

Parameters:

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

Returns:

(i)  always 1.

 

Before calling this function, you must use wntUserAddDat to set parameters for the new user account. At a minimum, you must set the "name" element. The other elements will receive default values.

 

Calling this function does not reset elements in the user parameter structure. So, you can set various elements, add a user, then change just the "name" element and add another user. All other elements will retain their previous values. To clear all elements, call wntUserAddDat specifying blank strings for "variable" and "value".

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

 
wntUserAddDat("name", "jdoe") wntUserAddDat("full_name", "John Doe") wntUserAddDat("flags", 1) wntUserAddDat("acct_expires", "0000:00:00:00:00:00") wntUserAdd("") Exit
;*OR*
;example to add a computer to the domain daserver="\\server" computername="work001" NametoAdd=StrUpper(StrCat(computername,"$")) wntUserAddDat("name", NametoAdd) wntUserAddDat("flags", 4096+1); wntUserAddDat("acct_expires", "0000:00:00:00:00:00") wntUserAdd(daserver) Exit
See Also:

wntUserAddDat