Photo Test
Subscribe
More About This Website

Well, you've made it this far so I guess I should talk about something.

Let's see.... mmm

I'll start with my job an give you some real project I've been working on. So I'll speak about computer hardware, VMware, Unattended Windows installation, VBScript, XML, Website, and some other stuff. Enjoy!

Login
« Adobe Creative Suite 3 is Pure Crap! | Main | Vista Crap Edition with FAT64 support »
Monday
04Jun2007

VBScript to communicate with your "lusers"

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):

  1. Remote scripting enabled thru the firewall of the target computer (for WinXP SP2, Win2003 Server and Vista)
  2. 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.

909605-854382-thumbnail.jpg
We are Watching you!

Reader Comments (1)

hahaha good one Hulk
June 5, 2007 | Unregistered CommenterEtienne

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.