cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DashingMrDasher
Engaged Sweeper
Good morning,
I was able to find this post: http://www.lansweeper.com/Forum/yaf_postst6119_Remote-Control--VNC----usage-logging.aspx#post26795 which was very helpful, in providing a vb script with which I was able to implement logging for my Remote Control action; however, I would like some assistance with a minor modification that I can't seem to figure out. I want logging specifically for usage of a no permission Action, but can't seem to get the vb script to activate the lsremote.exe with the no permission switch pre-defined. Is anyone able to help me with this?

The action is currently {actionpath}remotecontrol.vbs {smartname}

The script is below:

If WScript.Arguments.Count = 1 Then
'Bring in target computer name
strRemoteComputer= WScript.Arguments(0)
'Grab the data and time of calling the script
strDate = Date()
strTime = Time()

strComputer = "."

Dim WshShell
Dim objFSO
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set WshShell = WScript.CreateObject ("WSCript.shell")
Set objFSO= CreateObject("Scripting.FileSystemObject")
Set objText = objFSO.OpenTextFile("\\<servername>\e$\Lansweeper\Logs\lsremotelog.txt", 8, True)
Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem")

'Find the username of the person clicking the link
For Each objItem in colItems
strUser = objItem.UserName
Next

'Write the log entry with Date, Time, User, and Target PC
objText.WriteLine(strDate & " " & strTime & " " & strUser & " " & strRemoteComputer)
objText.Close

'Run your command
WshShell.run("\\<servername>\e$\Lansweeper\Actions\lsremote.exe " & strRemoteComputer)

End If

Thank you!
Tim
0 REPLIES 0

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now