Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Script for Remote Wake on Lan

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-01-2008
Wayne Jordan
 
Posts: n/a
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.

Reply With Quote
  #2  
Old 29-01-2008
Pegasus \(MVP\)
 
Posts: n/a
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?


Reply With Quote
  #3  
Old 29-01-2008
Wayne Jordan
 
Posts: n/a
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

Reply With Quote
  #4  
Old 30-01-2008
Pegasus \(MVP\)
 
Posts: n/a
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
>



Reply With Quote
  #5  
Old 31-01-2008
Trevor Sullivan
 
Posts: n/a
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.

Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Script for Remote Wake on Lan"
Thread Thread Starter Forum Replies Last Post
Running script on remote machine SuderMan Windows Server Help 12 25-08-2010 06:51 PM
Wake UP a PC win7-based using Using Remote Desktop rtrimarchi Operating Systems 4 27-06-2010 03:23 PM
configure remote logon script via c# adam2010 Windows Software 3 04-05-2010 11:30 PM
Wake on LAN script wasim Software Development 3 25-08-2009 05:59 PM
a script to enable remote desktop at registery!!! Ahmad Sabry Windows Server Help 4 27-06-2007 06:26 AM


All times are GMT +5.5. The time now is 09:33 PM.