Kaseya Community

WOL with 4.8

  • I would like a script that can be run on a server at any client site, which will access the list of macs on site and issue WOL commands using RW.exe.

    I have seen all of the other posts on this subject, but none have worked quite right.

    I envision this script to also help to keep a current list of mac addresses without duplicates (Using DB views)

    I wrote a basic vb script to pull an individual computers mac address from the db, and format it to the way RW.exe wants it (no dashes). But past that I'm stumped as to how to get it into a master list without duplicates.

    Hopefully one of the scripting guru's can help!

    I appreciate it

    -Seth-


    Legacy Forum Name: WOL with 4.8,
    Legacy Posted By Username: sethcarter
  • On the 4.8/KES webinar, one of the presenters mentioned a new component that would easily enable WOL, but I haven't had time to replay the show, yet.

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: dataservcorp
  • Yeah, I believe it was the ability to read data from the SQL views. I have tried this, but need a way to do it for a whole site rather than for a single machine.


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: sethcarter
  • The presenter (Jim Alves, maybe?) had alluded to site-wide WOL. Sorry for not being clear about that.

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: dataservcorp
  • Oh I see. I'll go back through the presentation and see if I can gain some more clues.


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: sethcarter
  • If you find it please update us here.

    sethcarter wrote:
    Oh I see. I'll go back through the presentation and see if I can gain some more clues.



    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: Coldfirex
  • G'day folks,

    Has anyone seen an update on this where we can wake up ALL machine in a LAN? (well those that can handle WOL)

    Thanks
    Ryan "Fuzzy" Spillane




    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: CORRAS
  • runwol.txt
    Here is a script I use to individually wake machines when they go offline. An alert is set to trigger if a client has been offline for more that 30 minutes. It then runs this script on the management server we have at each client site.

    The part now allowed in 4.8 is grabbing the mac address from the database

    Get Variable
    Parameter 1 : 11
    Parameter 2 : vMachine/MacAddr/#id#
    Parameter 3 : macadd


    The ability to use the name of the machine that generated the alert (#id#) is also cool.

    I believe a more all-encompassing WOL script is also available......that may be where I got the original source of the vbs I modified to properly format the mac address.

    Script Name: Restart
    Script Description:

    IF Test File
    Parameter 1 : c:\temp\runwol.vbs
    Absent :
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : agenttemp
    OS Type : 0
    Write File
    Parameter 1 : #agenttemp#\netsvc.exe
    Parameter 2 : VSASharedFiles\Netsvc.exe
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\runwol.vbs
    Parameter 2 : VSASharedFiles\RunWOL.vbs
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\rw.exe
    Parameter 2 : VSASharedFiles\rw.exe
    OS Type : 0
    Execute Script
    Parameter 1 : Restart (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 : 2
    Parameter 3 : 1
    OS Type : 0
    ELSE
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : agenttemp
    OS Type : 0
    Execute Shell Command
    Parameter 1 : #agenttemp#\netsvc.exe /start \\#id# "KaseyaAgent"
    Parameter 2 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 11
    Parameter 2 : vMachine/MacAddr/#id#
    Parameter 3 : macadd
    OS Type : 0
    Execute Shell Command
    Parameter 1 : c:\temp\runwol.vbs #macadd#
    Parameter 2 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : c:\temp\wol.log
    Parameter 3 : wolresult
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : #id# awoken via script - #wolresult#
    OS Type : 0
    Delete File
    Parameter 1 : c:\temp\wol.log
    OS Type : 0




    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: karode
  • can you post the runWOL.vbs and the netsvc.exe so we can upload them to our kserver.



    Thanks


    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: tpeters
  • runwol.vbs was attached to the original post as runwol.txt (can't post .vbs). netsvc.exe is available in the resource kit

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: karode
  • So we need to change the script from runWOL.vbs to runWoL.txt?

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: tpeters
  • Might work better the other way round

    Legacy Forum Name: Script Requests,
    Legacy Posted By Username: karode