# Function Reference

# _Net_Share_StatisticsGetWrk

Retrieves operating statistics for a workstation

#include <NetShare.au3>
_Net_Share_StatisticsGetWrk ( [$sWorkStation = ""] )

## Parameters

$sWorkStation | [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] - Statistics collection start time. The value is stored as the number of seconds elapsed since 00:00:00, January 1, 1970. [ 1] - Bytes received by the workstation [ 2] - Server message blocks (SMBs) received by the workstation [ 3] - Bytes that have been read by paging I/O requests [ 4] - Bytes that have been read by non-paging I/O requests [ 5] - Bytes that have been read by cache I/O requests [ 6] - Bytes that have been read by disk I/O requests [ 7] - Bytes transmitted by the workstation [ 8] - SMBs transmitted by the workstation [ 9] - Bytes that have been written by paging I/O requests [10] - Bytes that have been written by non-paging I/O requests [11] - Bytes that have been written by cache I/O requests [12] - Bytes that have been written by disk I/O requests [13] - Network operations that failed to begin [14] - Network operations that failed to complete [15] - Read operations initiated by the workstation [16] - Random access reads initiated by the workstation [17] - Read requests the workstation has sent to servers [18] - Read requests the workstation has sent to servers that are greater than twice the size of the server's negotiated buffer size. [19] - Read requests the workstation has sent to servers that are less than 1/4 of the size of the server's negotiated buffer size. [20] - Write operations initiated by the workstation [21] - Random access writes initiated by the workstation [22] - Write requests the workstation has sent to servers [23] - Write requests the workstation has sent to servers that are greater than twice the size of the server's negotiated buffer size. [24] - Write requests the workstation has sent to servers that are less than 1/4 of the size of the server's negotiated buffer size. [25] - Raw read requests made by the workstation that have been denied [26] - Raw write requests made by the workstation that have been denied [27] - Network errors received by the workstation [28] - Workstation sessions that were established [29] - Imes the workstation attempted to create a session but failed [30] - Connections that have failed [31] - PCNET connections that have succeeded [32] - LanManager 20 connections that have succeeded [33] - LanManager 21 connections that have succeeded [34] - Windows NT connections that have succeeded [35] - Times the workstation was disconnected by a network server [36] - Sessions that have expired on the workstation [37] - Network connections established by the workstation [38] - Failed network connections for the workstation [39] - Current requests that have not been completed
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_StatisticsGetSvr

## 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 workstation statistics
        $aInfo = _Net_Share_StatisticsGetWrk(@ComputerName)
        _MemoWrite("NetStatisticsGetWrk")
        _MemoWrite("Statistics started ......: " & $aInfo[0])
        _MemoWrite("Bytes received ..........: " & $aInfo[1])
        _MemoWrite("SMBs received ...........: " & $aInfo[2])
        _MemoWrite("Paging I/O bytes ........: " & $aInfo[3])
        _MemoWrite("Non-paging I/O bytes ....: " & $aInfo[4])
        _MemoWrite("Cache I/O bytes ..... ...: " & $aInfo[5])
        _MemoWrite("Disk I/O bytes ..........: " & $aInfo[6])
        _MemoWrite("Bytes transmitted .......: " & $aInfo[7])
        _MemoWrite("SMBs transmitted ........: " & $aInfo[8])
        _MemoWrite("Paging I/O bytes ........: " & $aInfo[9])
        _MemoWrite("Non-paging I/O bytes ....: " & $aInfo[10])
        _MemoWrite("Cache I/O bytes .........: " & $aInfo[11])
        _MemoWrite("Disk I/O bytes ..........: " & $aInfo[12])
        _MemoWrite("Failed ops begin ........: " & $aInfo[13])
        _MemoWrite("Failed ops completed ....: " & $aInfo[14])
        _MemoWrite("Read operations .........: " & $aInfo[15])
        _MemoWrite("Random access reads .....: " & $aInfo[16])
        _MemoWrite("Read requests sent ......: " & $aInfo[17])
        _MemoWrite("Read requests big .......: " & $aInfo[18])
        _MemoWrite("Read requests small .....: " & $aInfo[19])
        _MemoWrite("Write operations ........: " & $aInfo[20])
        _MemoWrite("Random access writes ....: " & $aInfo[21])
        _MemoWrite("Write requests sent .....: " & $aInfo[22])
        _MemoWrite("Write requests big ......: " & $aInfo[23])
        _MemoWrite("Write requests small ....: " & $aInfo[24])
        _MemoWrite("Denied raw reads ........: " & $aInfo[25])
        _MemoWrite("Denied raw writes .......: " & $aInfo[26])
        _MemoWrite("Network errors ..........: " & $aInfo[27])
        _MemoWrite("Sessions established ....: " & $aInfo[28])
        _MemoWrite("Failed sessions .........: " & $aInfo[29])
        _MemoWrite("Failed connections ......: " & $aInfo[30])
        _MemoWrite("PCNET connections .......: " & $aInfo[31])
        _MemoWrite("NetShare 20 connections .: " & $aInfo[32])
        _MemoWrite("NetShare 21 connections .: " & $aInfo[33])
        _MemoWrite("WinNT connections .......: " & $aInfo[34])
        _MemoWrite("Disconnects .............: " & $aInfo[35])
        _MemoWrite("Sessions expired ........: " & $aInfo[36])
        _MemoWrite("Connections made ........: " & $aInfo[37])
        _MemoWrite("Connections failed ......: " & $aInfo[38])
        _MemoWrite("Incomplete requests .....: " & $aInfo[39])

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