NetStatisticsGet function

Retrieves operating statistics for a service. Currently, only the workstation and server services are supported.

Syntax


NET_API_STATUS NetStatisticsGet(
  _In_   LPWSTR server,
  _In_   LPWSTR service,
  _In_   DWORD level,
  _In_   DWORD options,
  _Out_  LPBYTE *bufptr
);

Parameters

server [in]

Pointer to a string that specifies the DNS or NetBIOS name of the server on which the function is to execute. If this parameter is NULL, the local computer is used.

service [in]

Pointer to a string that specifies the name of the service about which to get the statistics. Only the values SERVICE_SERVER and SERVICE_WORKSTATION are currently allowed.

level [in]

Specifies the information level of the data. This parameter can be the following value.

ValueMeaning
0

Return statistics about a workstation or a server. The bufptr parameter points to a STAT_WORKSTATION_0 or a STAT_SERVER_0 structure.

 

options [in]

This parameter must be zero.

bufptr [out]

Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.

Return value

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes.

Remarks

No special group membership is required to obtain workstation statistics. Only members of the Administrators or Server Operators local group can successfully execute the NetStatisticsGet function on a remote server.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Lmstats.h (include Lm.h)

Library

Netapi32.lib

DLL

Netapi32.dll

See also

Network Management Overview
Network Management Functions
Statistics Functions
NetServerGetInfo
STAT_SERVER_0
STAT_WORKSTATION_0

 

 

Community Additions

ADD
Show:
© 2014 Microsoft