# Function Reference

# _Net_Share_StatisticsGetSvr

Retrieves operating statistics for a server

#include <NetShare.au3>
_Net_Share_StatisticsGetSvr ( [$sServer = ""] )

## Parameters

$sServer | [optional] Specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is blank, the local computer is used.

## Return Value

Success: | an array with the following format: [ 0] - Indicates the time when statistics collection started. The value is stored as the number of seconds that have elapsed since 00:00:00, January 1, 1970, GMT. [ 1] - Indicates the number of times a file is opened on a server [ 2] - Indicates the number of times a server device is opened [ 3] - Indicates the number of server print jobs spooled [ 4] - Indicates the number of times the server session started [ 5] - Indicates the number of times the server session disconnected [ 6] - Indicates the number of times the server sessions failed with error [ 7] - Indicates the number of server password violations [ 8] - Indicates the number of server access permission errors [ 9] - Indicates the number of server system errors [10] - Number of server bytes sent to the network [11] - Number of server bytes received from the network [12] - Indicates the average server response time (in milliseconds) [13] - Indicates the number of times the server required a request buffer but failed to allocate one [14] - Indicates the number of times the server required a big buffer but failed to allocate one
Failure: | sets the @error flag to non-zero.

## Remarks

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

## Related

_Net_Share_StatisticsGetWrk

## See Also

Search NetStatisticsGet in MSDN Library.

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <GUIConstantsEx.au3>
    #include <NetShare.au3>
    #include <WindowsStylesConstants.au3>

    Example()

    Func Example()
        Local $aInfo

        ; Create GUI
        GUICreate("NetShare", 400, 300)

        ; Create memo control
        _MemoCreate(2, 2, 396, 296, $WS_VSCROLL)
        GUISetState(@SW_SHOW)

        ; Get server statistics
        $aInfo = _Net_Share_StatisticsGetSvr(@ComputerName)
        _MemoWrite("Statistics started ......: " & $aInfo[0])
        _MemoWrite("Times file opened .......: " & $aInfo[1])
        _MemoWrite("Times device opened .....: " & $aInfo[2])
        _MemoWrite("Print jobs spooled ......: " & $aInfo[3])
        _MemoWrite("Sessions started ........: " & $aInfo[4])
        _MemoWrite("Sessions disconnected ...: " & $aInfo[5])
        _MemoWrite("Session errors ..........: " & $aInfo[6])
        _MemoWrite("Password violations .....: " & $aInfo[7])
        _MemoWrite("Permission errors .......: " & $aInfo[8])
        _MemoWrite("Server system errors ....: " & $aInfo[9])
        _MemoWrite("Network bytes sent ......: " & $aInfo[10])
        _MemoWrite("Network bytes recv ......: " & $aInfo[11])
        _MemoWrite("Average response time ...: " & $aInfo[12])
        _MemoWrite("Req buffer failures .....: " & $aInfo[13])
        _MemoWrite("Big buffer failures .....: " & $aInfo[14])

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
    EndFunc   ;==>Example