Showing results for 
Show  only  | Search instead for 
Did you mean: 
Engaged Sweeper
Good morning,
I was able to find this post: 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 ("")
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

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

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

End If

Thank you!

New to Lansweeper?

Try Lansweeper For Free

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

Try Now