Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.51 KB

NetUserDel.md

File metadata and controls

57 lines (37 loc) · 1.51 KB

Home

Function name : NetUserDel

Group: Network Management - Library: netapi32


Deletes a user account from a server.


Code examples:

Adding and deleting User Accounts

Declaration:

NET_API_STATUS NetUserDel(
  LPCWSTR servername,
  LPCWSTR username
);  

FoxPro declaration:

DECLARE INTEGER NetUserDel IN netapi32;
	STRING servername,;
	STRING username
  

Parameters:

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.


Return value:

If the function succeeds, the return value is NERR_Success (0).


Comments:

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.