Group: Network Management - Library: netapi32
Adding and deleting User Accounts
NET_API_STATUS NetUserDel(
LPCWSTR servername,
LPCWSTR username
);
DECLARE INTEGER NetUserDel IN netapi32;
STRING servername,;
STRING username
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.
username [in] Pointer to a constant string that specifies the name of the user account to delete.
If the function succeeds, the return value is NERR_Success (0).
Windows NT: This servername must begin with \.
Only members of the Administrators or the Account Operators local group can successfully execute NetUserDel on a remote server or on a computer that has local security enabled. Only members of the Administrators local group can delete an Administrators privilege account.
See also: NetUserAdd, NetUserEnum, NetUserSetInfo.