Platform SDK: Network Management |
The NetValidateName function verifies the validity of a computer name, workgroup name, or domain name.
No special group membership is required to successfully execute the NetValidateName function.
NET_API_STATUS NetValidateName( LPCWSTR lpServer, LPCWSTR lpName, LPCWSTR lpAccount, LPCWSTR lpPassword, NETSETUP_NAME_TYPE NameType );
typedef enum _NETSETUP_NAME_TYPE { NetSetupUnknown = 0, NetSetupMachine, NetSetupWorkgroup, NetSetupDomain, NetSetupNonExistentDomain, #if(_WIN32_WINNT >= 0x0500) NetSetupDnsMachine #endif } NETSETUP_NAME_TYPE, *PNETSETUP_NAME_TYPE;
These values have the following meanings.
Value | Meaning |
---|---|
NetSetupMachine | Verify that the NetBIOS computer name is valid and that it is not in use. |
NetSetupWorkgroup | Verify that the workgroup name is valid. |
NetSetupDomain | Verify that the domain name exists and that it is a domain. |
NetSetupNonExistentDomain | Verify that the domain name is not in use. |
NetSetupDnsMachine | Verify that the DNS computer name is valid. |
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
Value | Meaning |
---|---|
ERROR_INVALID_PARAMETER | A parameter is incorrect. |
ERROR_DUP_NAME | A duplicate name already exists on the network. |
ERROR_NO_SUCH_DOMAIN | The specified domain did not exist. |
NERR_InvalidWorkgroupName | The specified workgroup name is not valid. |
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Lmjoin.h; include Lm.h.
Library: Use Netapi32.lib.