Skip to content

Latest commit

 

History

History
254 lines (198 loc) · 6.48 KB

nf-lmjoin-netenumeratecomputernames.md

File metadata and controls

254 lines (198 loc) · 6.48 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:lmjoin.NetEnumerateComputerNames
NetEnumerateComputerNames function (lmjoin.h)
Enumerates names for the specified computer.
NetAllComputerNames
NetAlternateComputerNames
NetComputerNameTypeMax
NetEnumerateComputerNames
NetEnumerateComputerNames function [Network Management]
NetPrimaryComputerName
lmjoin/NetEnumerateComputerNames
netmgmt.netenumeratecomputernames
netmgmt\netenumeratecomputernames.htm
NetMgmt
c657ae33-404e-4c36-a956-5fbcfa540be7
12/05/2018
NetAllComputerNames, NetAlternateComputerNames, NetComputerNameTypeMax, NetEnumerateComputerNames, NetEnumerateComputerNames function [Network Management], NetPrimaryComputerName, lmjoin/NetEnumerateComputerNames, netmgmt.netenumeratecomputernames
lmjoin.h
Lm.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Netapi32.lib
Netapi32.dll
Windows
19H1
NetEnumerateComputerNames
lmjoin/NetEnumerateComputerNames
c++
APIRef
kbSyntax
DllExport
Netapi32.dll
NetEnumerateComputerNames

NetEnumerateComputerNames function

-description

The NetEnumerateComputerNames function enumerates names for the specified computer.

-parameters

-param Server [in, optional]

A pointer to a constant string that specifies the name of the computer on which to execute this function. If this parameter is NULL, the local computer is used.

-param NameType [in]

The type of the name queried. This member can be one of the following values defined in the NET_COMPUTER_NAME_TYPE enumeration defined in the Lmjoin.h header file.

Value Meaning
NetPrimaryComputerName
The primary computer name.
NetAlternateComputerNames
Alternate computer names.
NetAllComputerNames
All computer names.
NetComputerNameTypeMax
Indicates the end of the range that specifies the possible values for the type of name to be queried.

-param Reserved [in]

Reserved for future use. This parameter should be NULL.

-param EntryCount [out]

A pointer to a DWORD value that returns the number of names returned in the buffer pointed to by the ComputerNames parameter if the function succeeds.

-param ComputerNames [out]

A pointer to an array of pointers to names. If the function call is successful, this parameter will return the computer names that match the computer type name specified in the NameType parameter.

When the application no longer needs this array, this buffer should be freed by calling NetApiBufferFree function.

-returns

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 or one of the system error codes.

Return code Description
ERROR_ACCESS_DENIED
Access is denied. This error is returned if the caller was not a member of the Administrators local group on the target computer.
ERROR_INVALID_PARAMETER
A parameter is incorrect.
ERROR_NOT_ENOUGH_MEMORY
Not enough memory is available to process this command.
ERROR_NOT_SUPPORTED
The request is not supported. This error is returned if the target computer specified in the Server parameter on which this function executes is running on Windows 2000 and earlier.
NERR_WkstaNotStarted
The Workstation service has not been started.
RPC_S_CALL_IN_PROGRESS
A remote procedure call is already in progress for this thread.
RPC_S_PROTSEQ_NOT_SUPPORTED
The remote procedure call protocol sequence is not supported.

-remarks

The NetEnumerateComputerNames function is supported on Windows Vista and later.

The NetEnumerateComputerNames function is used to request the names a computer currently has configured.

The NetEnumerateComputerNames function requires that the caller is a member of the Administrators local group on the target computer.

-see-also

NetAddAlternateComputerName

NetJoinDomain

NetRemoveAlternateComputerName

NetRenameMachineInDomain

NetSetPrimaryComputerName

NetUnjoinDomain

SetComputerNameEx