| View previous topic :: View next topic |
| Author |
Message |
EdLevin
Joined: 12 Apr 2006 Posts: 208 Location: Encino, CA
|
Posted: Mon Apr 28, 2008 1:08 pm Post subject: Wake on LAN Script |
|
|
This script, Wake On LAN, can be used for waking offline WOL-enabled PCs from another PC that is online on the same LAN by using the RW.EXE utility. This script wakes one system at a time (see script description) and uses Kaseya SQL Views so that you don't have to deal with MAC addresses directly.
Step 4 uses the Windows CLI FOR command to remove dashes from the MAC address as required by RW.EXE.
This script can be found under Public Scripts, Workstation Scripts on SMC Kaseya server
| Code: | Script Name: Wake On LAN
Script Description: Wake-On-LAN Script: uses a freeware RW.EXE utility to wake up a WOL-Enabled PC from an online PC on the same LAN against which this script is run (both PCs need to have Kaseya agents on them).
Modify STEP 3 and change AGENTID.GROUPID to the full name of the agent you are trying to wake up.
IF True
THEN
Get Variable
Parameter 1 : 10
Parameter 2 :
Parameter 3 : agentTemp
OS Type : 1
Write File
Parameter 1 : #agentTemp#\rw.exe
Parameter 2 : VSASharedFiles\rw.exe
OS Type : 1
Get Variable
Parameter 1 : 11
Parameter 2 : vMachine/MacAddr/AGENTID.GROUPID
Parameter 3 : macAddr
OS Type : 1
Execute Shell Command
Parameter 1 : for /f "tokens=1-6 delims=-" %i in ('echo #macAddr#') do @echo %i%j%k%l%m%n >> #agentTemp#\mac.txt
Parameter 2 : 1
OS Type : 1
Get Variable
Parameter 1 : 1
Parameter 2 : #agentTemp#\mac.txt
Parameter 3 : mac
OS Type : 1
Execute Shell Command
Parameter 1 : #agentTemp#\rw.exe /m:#mac# >> #agentTemp#\result.txt
Parameter 2 : 1
OS Type : 1
Get Variable
Parameter 1 : 1
Parameter 2 : #agentTemp#\result.txt
Parameter 3 : wolResult
OS Type : 1
Write Script Log Entry
Parameter 1 : #wolResult#
OS Type : 1
Delete File
Parameter 1 : #agentTemp#\rw.exe
OS Type : 1
Delete File
Parameter 1 : #agentTemp#\mac.txt
OS Type : 1
Delete File
Parameter 1 : #agentTemp#\result.txt
OS Type : 1
ELSE |
_________________ Ed Levin
CTO
Cloud Services Depot, Inc.
15821 Ventura Blvd Suite 275
Encino, CA 91436
818-926-2600 x 102
818-990-1897 (fax)
http://www.cloudservicesdepot.com |
|
| Back to top |
|
 |
venamore
Joined: 03 Jul 2009 Posts: 1
|
Posted: Fri Nov 13, 2009 1:29 am Post subject: |
|
|
I haven't had any success with running this.
I have updated the machineid.groupid on step 3, and am running it on another machine on the LAN (have tried both the DC and another client) but it keeps failing on step 3 still.
Any ideas? Thanks.  |
|
| Back to top |
|
 |
DanielGrable
Joined: 20 Dec 2007 Posts: 15
|
Posted: Tue Nov 24, 2009 10:19 am Post subject: Solution |
|
|
Hi Venamore,
I see a space in the text in step 3: “/MacAddr/ trm02”. It’s between the / and the t. Removing that should fix it. _________________ Daniel Grable
Technology Specialist
CloudServicesDepot.com
15821 Ventura Blvd Suite 275
Encino, CA 91436
818-926-4500 x 103
818-990-1897 (fax)
http://www.cloudservicesdepot.com |
|
| Back to top |
|
 |
|