VBScript to communicate with your "lusers"
Monday, June 4, 2007 at 21:48 Remember the old net send command? Well, this feature is now disabled starting with Windows XP SP2 so here is a script which allows you to communicate with the user logged on a computer in your network. The trick is the use of the Win32_ScheduledJob class which is the only way to get an interaction with the user currently logged on.
Requirements (2):
- Remote scripting enabled thru the firewall of the target computer (for WinXP SP2, Win2003 Server and Vista)
- Administrative rights on the target computer
Here is the script:
strComputer = "johnny-pc" '## Name, FQDN or IP address
strNameSpace = "\root\cimv2"
strUserName = "administrator" '## OR Domain\User
strPassword = "password"
strDate = "20070604" '## The date - YYYYMMDD
strHour = "083000" '## The hour - HHMMSS
strZone = "-240" '## TimeZone * 60 (- 60 if daylight saving)
When = strDate & strHour & ".000000" & strZone
Set objWbemLocator = CreateObject _
("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer _
(strComputer, strNameSpace, strUserName, strPassword)
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")errJobCreated = objNewJob.Create _
("\\server\share\something.hta", When, False, , , True, JobId)
If errJobCreated < > 0 Then
Wscript.Echo "Error on task creation"
Else
Wscript.Echo "Task created"
End If
See that \\Server\Share\something.hta? This is where you specify the stuff to execute (in interactive mode) on the remote computer.
For example I created a FullScreen HTA with the following image showing right in the face of my co-workers:
It's in french but it says Warning, your computer is currently monitored for illegal activities... blablablah... legal stuff... Please report yourself to your local police dept.
Reader Comments (1)