Sven Posted June 7, 2010 Share Posted June 7, 2010 (edited) Having a problem getting _Net_Share_SessionGetInfo() to work. I'm at a Win7 x64 machine named "Comp1", the intention is to monitor its network connections (active time, idle time, who opened the connection). User Name is "Admin", which is an administrator account. But the following script expandcollapse popup#include <GuiConstantsEx.au3> #include <NetShare.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $sServer, $aInfo ; Create GUI $hGUI = GUICreate("NetShare", 400, 300) ; Create memo control $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() ; Get session information $aInfo = _Net_Share_SessionGetInfo ("Comp1", "Comp1", "Admin") MemoWrite("Error ..........: " & @error) MemoWrite("Computer name ..: " & $aInfo[0]) MemoWrite("User name ......: " & $aInfo[1]) MemoWrite("Resources open .: " & $aInfo[2]) MemoWrite("Seconds active .: " & $aInfo[3]) MemoWrite("Seconds idle ...: " & $aInfo[4]) MemoWrite("Connection type : " & $aInfo[5]) MemoWrite("Client type ....: " & $aInfo[6]) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite always returns Error ..........: 0 Computer name ..: User name ......: Resources open .: Seconds active .: Seconds idle ...: Connection type : Client type ....: no matter what I do, although there are active connections. What am I doing wrong? Any help is greatly appreciated. PS: Why is it that the search function of this forum cannot find anything about _Net_Share_SessionGetInfo? It should at least list this here topic, but no... Edited June 7, 2010 by Sven Link to comment Share on other sites More sharing options...
Sven Posted June 7, 2010 Author Share Posted June 7, 2010 Anyone? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now