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 <GUIConstantsEx.au3>
#include <NetShare.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
        Local $aInfo

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

        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        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

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite