Results 1 to 5 of 5

Thread: Script for Remote Wake on Lan

  1. #1
    Wayne Jordan Guest

    Script for Remote Wake on Lan

    We use a product for managed services called Kaseya and I can run custom
    scripts for almost any task I need, well if I were better at scripting I
    could :-). My situation is I need to be able to run a script that will
    execute the wol.exe /m:MacAddress. The script would be executed from a server
    inside the lan. The mac address is stored in kaseya which i can grab using a
    variable #vMachine.MacAddr#. Unfortunately the way it is formatted
    "00-00-00-00-00" means i need to strip out the "-" before executing the
    script. I will need to replace the variable with the actual mac address
    before execution. I hope someone can help me or lead me in the right
    direction. Thanks in advance for your help.

  2. #2
    Pegasus \(MVP\) Guest

    Re: Script for Remote Wake on Lan


    "Wayne Jordan" <Wayne Jordan@discussions.microsoft.com> wrote in message
    news:83BDAE2D-4619-499A-B101-DD42B69F8E28@microsoft.com...
    > We use a product for managed services called Kaseya and I can run custom
    > scripts for almost any task I need, well if I were better at scripting I
    > could :-). My situation is I need to be able to run a script that will
    > execute the wol.exe /m:MacAddress. The script would be executed from a
    > server
    > inside the lan. The mac address is stored in kaseya which i can grab using
    > a
    > variable #vMachine.MacAddr#. Unfortunately the way it is formatted
    > "00-00-00-00-00" means i need to strip out the "-" before executing the
    > script. I will need to replace the variable with the actual mac address
    > before execution. I hope someone can help me or lead me in the right
    > direction. Thanks in advance for your help.


    I'm a little unclear about the process flow. Does it go like so?
    1. You're in Kaseya.
    2. You click the WakeUp button.
    3. Kaseya calls ??? with a parameter of 0a-bc-11-34-06-bb (for example).
    4. Your script turn this address into 0abc113406bb.
    5. Your script invokes this command: wol.exe /m:0abc113406bb.

    What is the ??? bit?



  3. #3
    Wayne Jordan Guest

    Re: Script for Remote Wake on Lan

    > I'm a little unclear about the process flow. Does it go like so?
    > 1. You're in Kaseya.


    Yes, Kaseya is similar to Altiris or SMS. All managed workstations have
    agents on them and kaseya collects that data and puts it into a sql database.

    > 2. You click the WakeUp button.


    This would be the Script I write. I would select each machine i want to wake
    up and kaseya would execute that script from a local server in the lan

    > 3. Kaseya calls ??? with a parameter of 0a-bc-11-34-06-bb (for example).


    based on which machine i click on i can grab the #vMachine.MacAddr# which is
    the mac address stored in the sql database for that machine

    > 4. Your script turn this address into 0abc113406bb.


    Yes.

    > 5. Your script invokes this command: wol.exe /m:0abc113406bb.


    Yes, kaseya would execute this as a shell command on the server. The only
    thing that would be better if i could find a wake on lan that wouldn't care
    about the format of the mac address :-).

    >
    > What is the ??? bit?


    kaseya would execute this as if one machine at a time so i would be able to
    use the variable from the machine id to capture the #vMachineMacAddr#.

    Hope this helps clarify, Thanks


  4. #4
    Pegasus \(MVP\) Guest

    Re: Script for Remote Wake on Lan

    Unfortunately your answer did not really tell me anything
    about the ??? bit, so I will assume that ??? can be a batch
    file of your own choice with the MAC-address being its
    parameter. If so then the simplest solution would go like so:

    @echo off
    set mac=%1
    echo wol.exe /m:%mac:-=%


    "Wayne Jordan" <WayneJordan@discussions.microsoft.com> wrote in message
    news:57C4DFEC-FEC3-43F8-8C13-676D3F00CFE2@microsoft.com...
    >> I'm a little unclear about the process flow. Does it go like so?
    >> 1. You're in Kaseya.

    >
    > Yes, Kaseya is similar to Altiris or SMS. All managed workstations have
    > agents on them and kaseya collects that data and puts it into a sql
    > database.
    >
    >> 2. You click the WakeUp button.

    >
    > This would be the Script I write. I would select each machine i want to
    > wake
    > up and kaseya would execute that script from a local server in the lan
    >
    >> 3. Kaseya calls ??? with a parameter of 0a-bc-11-34-06-bb (for example).

    >
    > based on which machine i click on i can grab the #vMachine.MacAddr# which
    > is
    > the mac address stored in the sql database for that machine
    >
    >> 4. Your script turn this address into 0abc113406bb.

    >
    > Yes.
    >
    >> 5. Your script invokes this command: wol.exe /m:0abc113406bb.

    >
    > Yes, kaseya would execute this as a shell command on the server. The only
    > thing that would be better if i could find a wake on lan that wouldn't
    > care
    > about the format of the mac address :-).
    >
    >>
    >> What is the ??? bit?

    >
    > kaseya would execute this as if one machine at a time so i would be able
    > to
    > use the variable from the machine id to capture the #vMachineMacAddr#.
    >
    > Hope this helps clarify, Thanks
    >




  5. #5
    Trevor Sullivan Guest

    Re: Script for Remote Wake on Lan

    Just do:

    NewMac = replace(OldMac, "-", "")

    That will remove the dashes.

    Also, instead of using a command-line utility to do Wake On LAN,
    consider using this free, scriptable component I found a while ago:

    http://www.depicus.com/wake-on-lan/wake-on-lan-com.aspx

    Hope this helps.

    ----------------
    Trevor Sullivan
    Systems Engineer

    Wayne Jordan wrote:
    > We use a product for managed services called Kaseya and I can run custom
    > scripts for almost any task I need, well if I were better at scripting I
    > could :-). My situation is I need to be able to run a script that will
    > execute the wol.exe /m:MacAddress. The script would be executed from a server
    > inside the lan. The mac address is stored in kaseya which i can grab using a
    > variable #vMachine.MacAddr#. Unfortunately the way it is formatted
    > "00-00-00-00-00" means i need to strip out the "-" before executing the
    > script. I will need to replace the variable with the actual mac address
    > before execution. I hope someone can help me or lead me in the right
    > direction. Thanks in advance for your help.


Similar Threads

  1. Running script on remote machine
    By SuderMan in forum Windows Server Help
    Replies: 12
    Last Post: 25-08-2010, 06:51 PM
  2. Wake UP a PC win7-based using Using Remote Desktop
    By rtrimarchi in forum Operating Systems
    Replies: 4
    Last Post: 27-06-2010, 03:23 PM
  3. configure remote logon script via c#
    By adam2010 in forum Windows Software
    Replies: 3
    Last Post: 04-05-2010, 11:30 PM
  4. Wake on LAN script
    By wasim in forum Software Development
    Replies: 3
    Last Post: 25-08-2009, 05:59 PM
  5. a script to enable remote desktop at registery!!!
    By Ahmad Sabry in forum Windows Server Help
    Replies: 4
    Last Post: 27-06-2007, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •