<div class="content"><p> </p><p>The NetrServerStatisticsGet method retrieves the operating
statistics for a service.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrServerStatisticsGet(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in, string, unique] WCHAR* Service,
   [in] DWORD Level,
   [in] DWORD Options,
   [out] LPSTAT_SERVER_0* InfoStruct
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <span><a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a></span>
pointer that identifies the <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>. The <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST map this structure to an RPC binding handle (see <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span> sections
4.3.5 and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>Service: </b>A pointer to a null-terminated UTF-16
string. This parameter MUST be ignored on receipt.</p><p><b>Level: </b>Specifies the information level of the
data. This MUST be set to 0.</p><p><b>Options: </b>Reserved; MUST be 0.</p><p><b>InfoStruct: </b>A pointer to the buffer that
receives the data, as specified in section <span><a href="d54c2739-eb74-46c3-9224-50294ccc5d4d" data-linktype="relative-path">2.2.4.39</a></span>. This
pointer is in the format of STAT_SERVER_0.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success; otherwise, it returns a nonzero error code.
The method can take any specific error code value, as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.
</p><p>In response to the NetrServerStatisticsGet message, the
server MUST return the operating statistics for the service or return an error
code.</p><p>The server MUST ignore the <i>Service</i> parameter on
receipt.</p><p>If the <i>Level</i> parameter is not equal to 0, the server
MUST fail the call with an ERROR_INVALID_LEVEL error code.</p><p>If the <i>Options</i> parameter is not equal to 0, the
server MUST fail the call with an ERROR_INVALID_PARAMETER error code.</p><p>The server MUST query the statistics by invoking the
underlying server events as specified in <span><a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a></span>
section <span><a href="../ms-cifs/0542a8a7-82f4-4dce-a162-bcff82e03705" data-linktype="relative-path">3.3.4.23</a></span>
and <span><a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a></span>
section <span><a href="../ms-smb2/7876d99f-7fb7-4ee7-bfac-0939ca2ccd82" data-linktype="relative-path">3.3.4.24</a></span>.
The server MUST aggregate all the values in the structures received from both
CIFS and SMB2 servers into a new <b>STAT_SERVER_0</b> structure. In addition to
these values, <i>sts0_start</i> MUST be set to <b>StatisticsStartTime</b>. The
server MUST return the statistics in the <b>STAT_SERVER_0</b> structure in the
InfoStruct parameter.</p><p>The server SHOULD<a id="Appendix_A_Target_87"></a><a aria-label="Product behavior note 87" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_87" data-linktype="relative-path">&lt;87&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this routine. If the caller does not have the required credentials, the
server SHOULD<a id="Appendix_A_Target_88"></a><a aria-label="Product behavior note 88" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_88" data-linktype="relative-path">&lt;88&gt;</a> fail the call.</p></div>