Cloud Services Depot Forum Index Cloud Services Depot
Cloud Services Depot Forum
 
 RSS feed for the SecureMyCompany forum    FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wake on LAN Script

 
Post new topic   Reply to topic    Cloud Services Depot Forum Index -> Kaseya Scripts
View previous topic :: View next topic  
Author Message
EdLevin



Joined: 12 Apr 2006
Posts: 208
Location: Encino, CA

PostPosted: Mon Apr 28, 2008 1:08 pm    Post subject: Wake on LAN Script Reply with quote

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
View user's profile Send private message Visit poster's website
venamore



Joined: 03 Jul 2009
Posts: 1

PostPosted: Fri Nov 13, 2009 1:29 am    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
DanielGrable



Joined: 20 Dec 2007
Posts: 15

PostPosted: Tue Nov 24, 2009 10:19 am    Post subject: Solution Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cloud Services Depot Forum Index -> Kaseya Scripts All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Board Security

Powered by phpBB © 2001, 2005 phpBB Group