Group: Network Management - Library: netapi32
Adding and deleting User Accounts
NET_API_STATUS NetUserAdd(
LMSTR servername,
DWORD level,
LPBYTE buf,
LPDWORD parm_err
);
DECLARE INTEGER NetUserAdd IN netapi32;
STRING servername,;
INTEGER lvl,;
STRING @ buf,;
INTEGER parm_err
servername [in] Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
level [in] Specifies the information level of the data (1..4).
buf [in] Pointer to the buffer that specifies the data.
parm_err [out] Pointer to a value that receives the index of the first member of the user information structure that causes ERROR_INVALID_PARAMETER.
If the function succeeds, the return value is NERR_Success (0).
Windows NT: Only members of the Administrators or Account Operators local group can successfully execute the NetUserAdd function. Only members of the Administrators local group can add an Administrators privilege account.
See also: NetUserEnum, NetUserSetInfo, NetUserDel.