Kaseya Community

Wake on Lan - Kaseya Machine Group

  • WakeUpGroup.zip
    Attached are the required files to wakeup machines using the kaseya machine.group.id.

    This has been something we have needed and finally had the time to get our best man onto it.

    Basic procedure is:
    1. Run script on agent which visits #kaseyaurl#/updatemaclist.asp to update mac list text file on kaseya server
    2. Copy mac list to agent temp folder
    3. Run script on agent to check mac list for matching groups and run rw.exe for each match
    4. Delete mac list and scripts from agent temp folder
    5. Email log to #email#



    Cheers

    Legacy Forum Name: Wake on Lan - Kaseya Machine Group,
    Legacy Posted By Username: Steve Morris
  • steve

    i am facing lot of challange in turning on machines using WOL script through kaseya. I have created a script as highlighted in the screen shot attached but that never turned on any machine. Although script status shows as successfully ran but it never turned on any machine.
    Same machine i could turn on using rw.exe /m: by making a batch file in the folder where i have kept vb script and rw file.

    please help
    Thanks

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rajeevsharma
  • wake all in LAN1.jpg
    here is the screen shot

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rajeevsharma
  • Hi, try this basic script that kaseya publish



    Once you have imported and run it

    Has the rw.exe been copied to the computer performing the wakeup
    No? Have you uploaded rw.exe to the kaseya shared files?

    If you have and it still didnt copy it accross; just copy the rw.exe manually over.







    Script Name: Wakeup Single machine
    Script Description: Copy the Remote Wake program to the C drive. Then Execute the program in the command prompt telling it to use MAC Address. Change the 00d0b94d05cd to the computer you want awake. This script runs on an awake agent connected to the same lan as a machine sleeping or off. The Bios must be set to accept wake on lan.

    IF True
    THEN
    Write File
    Parameter 1 : C:\rw.exe
    Parameter 2 : VSASharedFiles\rw.exe
    OS Type : 0
    Execute Shell Command
    Parameter 1 : c:\rw.exe /m:COMPUTERMACADDRESS
    Parameter 2 : 1
    OS Type : 0
    ELSE

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Steve Morris
  • Rajeev,
    I cannot see your screen shot clearly.
    Can you use the Export Script function. Then place this on the thread as text.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: garry
  • garry
    Rajeev,
    I cannot see your screen shot clearly.
    Can you use the Export Script function. Then place this on the thread as text.



    Script Name: WakeMachines-Rajeev
    Script Description: Copy the Remote Wake and VBS program to the C drive. Then Execute the program in the command prompt telling it to use all MAC Address in the Lanwatch list. NOTE: Lanwatch must be scheduled to run this script succesful!

    IF Test File
    Parameter 1 : C:\temp\LAN_Stat.xml
    Exists :
    THEN
    Write File
    Parameter 1 : c:\temp\WakeAllOnLan.vbs
    Parameter 2 : VSASharedFiles\WakeAllOnLan.vbs
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\rw.exe
    Parameter 2 : VSASharedFiles\rw.exe
    OS Type : 0
    Pause Script
    Parameter 1 : 5
    OS Type : 0
    Execute Shell Command
    Parameter 1 : c:\temp\WakeAllOnLan.vbs
    Parameter 2 : 0
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Wake all machines has run!
    OS Type : 0
    ELSE
    Write Script Log Entry
    Parameter 1 : No active Lan state found
    OS Type : 0

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rajeevsharma
  • Questions
    If you go to the c:\temp directory of the computer you are running the script on are any of the required files present( not the one you are trying to wake up; the machine that is actully executing the rw.exe)
    - LAN_Stat.xml - NO? Lan Watch needs to be enabled on the computer/agent
    - WakeAllOnLan.vbs - NO? Did you upload it to shared files
    - rw.exe - NO? Did you upload it to shared files




    Sorry if these seem obvious questions but best to check the basics first.

    Did you try the wake up group script I posted?


    rajeevsharma
    Script Name: WakeMachines-Rajeev
    Script Description: Copy the Remote Wake and VBS program to the C drive. Then Execute the program in the command prompt telling it to use all MAC Address in the Lanwatch list. NOTE: Lanwatch must be scheduled to run this script succesful!

    IF Test File
    Parameter 1 : C:\temp\LAN_Stat.xml
    Exists :
    THEN
    Write File
    Parameter 1 : c:\temp\WakeAllOnLan.vbs
    Parameter 2 : VSASharedFiles\WakeAllOnLan.vbs
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\rw.exe
    Parameter 2 : VSASharedFiles\rw.exe
    OS Type : 0
    Pause Script
    Parameter 1 : 5
    OS Type : 0
    Execute Shell Command
    Parameter 1 : c:\temp\WakeAllOnLan.vbs
    Parameter 2 : 0
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Wake all machines has run!
    OS Type : 0
    ELSE
    Write Script Log Entry
    Parameter 1 : No active Lan state found
    OS Type : 0


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Steve Morris
  • First of all thanks for replying STEVE

    I am realy very poor in scripting part. I looked at training video and followed steps to create the script which i have attached. My requirement is that we want to create a script to wake all machines in LANs.

    Yest i have already uploaded rw.exe and WakeAllOnLAN.vbs as i got from kaseya training portal "handouts" folder.

    If you can help me with this ir realy will be gr8 thing for me, because i am struggling with WOL for a month now. Eek

    Thanks
    Rajeev

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rajeevsharma
  • Steve Morris
    Hi, try this basic script that kaseya publish



    Once you have imported and run it

    Has the rw.exe been copied to the computer performing the wakeup
    No? Have you uploaded rw.exe to the kaseya shared files?

    If you have and it still didnt copy it accross; just copy the rw.exe manually over.







    Script Name: Wakeup Single machine
    Script Description: Copy the Remote Wake program to the C drive. Then Execute the program in the command prompt telling it to use MAC Address. Change the 00d0b94d05cd to the computer you want awake. This script runs on an awake agent connected to the same lan as a machine sleeping or off. The Bios must be set to accept wake on lan.

    IF True
    THEN
    Write File
    Parameter 1 : C:\rw.exe
    Parameter 2 : VSASharedFiles\rw.exe
    OS Type : 0
    Execute Shell Command
    Parameter 1 : c:\rw.exe /m:COMPUTERMACADDRESS
    Parameter 2 : 1
    OS Type : 0
    ELSE


    Can you please also send the screen shots for NIC card settings, because i find different views by everyone around while googling it.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rajeevsharma
  • Steve,
    Do I place the files from your ZIP as they are in the managed files directory? I mean should I create the nested folder structure:
    WebPages > ManagedFiles > VSASharedFiles > MacList
    With the .asp and .vbs files in the appropriate places?
    If you could step by step walk us through How to take your ZIP file and get a script running on our Kaseya that would be most helpful.
    Thanks!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: emersonlenon
  • Hi

    The next version of Kaseya is supposed to have WOL built in.... or at least that is what I remember from the conference.

    hc

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: howardc
  • here goes .
    1.Wake Up Group.asp >> this is actaully the script; copy text and import
    2.updatemaclist.asp>> copy to C:\Kaseya\WebPages\(on Kaseya Server)
    When this is called via script it will populate the txt file in -
    C:\Kaseya\WebPages\ManagedFiles\VSASharedFiles\MacList\MacList.txt

    3. The 2 vbs files and the rw.exe should be uploaded into Kaseya Shared VSA

    4. Update the required script variables and run against the customer server(machine that is on at least)It will attempt to wake all others in the group.. must match the group variable you entered.

    You should get an email with the results of what was attempted
    If issues, check the rw.exe and vbs files correctly uploaded to endpoint
    Copy manually via ftp to Temp directpry if needed for testing

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Steve Morris
  • P.S

    You must update ethe server connection details in updatemaclist.asp so it can query your K server to get the data

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Steve Morris
  • Is there any way to run it on all groups?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: emersonlenon
  • If they are sub groups,yes

    if you mean all groups on different sites,no

    You should look at the WOL script that uses Lanwatch and just run it against all your lan watch agents

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Steve Morris