How to Schedule A Task To Wake On Lan (WOL) All Other Computers (PCs) On A Network After I Start My Main Computer In Windows 7 Without Extra Applications

I have searched through google and there seems to be many ways to do this but most you have to install some sort of application. This is a learning curve for me but basically I have 4-5 other computers on a network that when I start the main computer (PC1) I want the other 4-5 computers to power on also.

I have experience with running scheduled tasks and I have enabled in the bios and my network cards to Wake On Lan (WOL). I have set automatic startups before using the task scheduler but this is not what I need. My schedule is to erratic.

It appears I need to send a "Magic Packet" and this is new to me. I am hoping I can run a Script of some kind in the task scheduler to send these magic packets out to the other PCs. I am using windows 7 on all the PCs.

Thank you for the help!
Dustin StanleyEntrepreneurAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hello ThereSystem AdministratorCommented:
First, all NICs must support WOL.
Wol requires the receipt of a Magic packet on a Nic that has wol enabled.
The magic packet has to be addressed to the physical address of the nic, MAC Address.

The process would be to install the network application capable of transmitting this magic packet, and the scheduled task is to run the task on boot, sending packets to each system

Are the distances among all the computers so vast or phrased better, I understand a dependency of all on the 1st computer that needs to be powered up first, what is the interdependency among the remaining?
Hello ThereSystem AdministratorCommented:
Second, you cannot do it via Task Scheduler on clients.
It's scheduler. You need to know WHEN to do the action. I mean you need to know the time. E.G. every day at 8 a.m. and so, every two hours.

But you might be able to send WOL via PS1 on your main computer... Maybe you will be able to do it via Task Scheduler if you will run it on startup. Then it will send a magic packet to clients... But I have never tried this...
Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

Dustin StanleyEntrepreneurAuthor Commented:
Hello There
First, all NICs must support WOL.
They do.

Second, you cannot do it via Task Scheduler.
There is a option for On Startup.

Are the distances among all the computers so vast or phrased better, I understand a dependency of all on the 1st computer that needs to be powered up first, what is the interdependency among the remaining?
This part I don't get 100%. The main PC controls a Backend of a Database and the computers are spread out.

Also I found this online but as I said I am very new to this area. Does this look legitimate and how would I execute it exactly???
param (\\[String\\]$MACAddrString = $(throw 'No MAC addressed passed, please pass as xx:xx:xx:xx:xx:xx'))
 $MACAddr = $macAddrString.split(':') | %\\{ \\[byte\\]('0x' + $_) \\}
 if ($MACAddr.Length -ne 6)
     throw 'MAC address must be format xx:xx:xx:xx:xx:xx'
 $UDPclient = new-Object System.Net.Sockets.UdpClient
 $packet = \\[byte\\[\\]\\](,0xFF * 6)
 $packet += $MACAddr * 16
 \\[void\\] $UDPclient.Send($packet, $packet.Length)
 write "Wake-On-Lan magic packet sent to $MACAddrString, length $($packet.Length)"

Open in new window

Appears to be powershell.

You can not run on boot per se, your execute has to wait until the network sets up or, the task will run firing packets that go nowhere.

The on boot task could be to schedule the transmission of the magic packets 10 minutes later as a single event presuming this shoukd be enough for the system's network to come up.

In your case you would read the MAC addresses from a file and loop through them sending packet.

Ms has a powershell cmdlet reference.

The following deals with the new-object call,

It has to be tested against the version on your system, you mentioned Windows 7, the implementation might be different.
Hello ThereSystem AdministratorCommented:
I know there is such an option (if you would read my post properly you would notice that this function is a part of my suggestion). I am just talking about impossibility to use this on CLIENT machines in your situation. Thanks for understanding.
Dustin StanleyEntrepreneurAuthor Commented:
In the Powershell Function Script that Hello There provided in the link above it looks like this:
function Send-WOL
    Send a WOL packet to a broadcast address
   The MAC address of the device that need to wake up
   The IP address where the WOL packet will be sent to
   Send-WOL -mac 00:11:32:21:2D:11 -ip 

$broadcast = [Net.IPAddress]::Parse($ip)
$target=0,2,4,6,8,10 | % {[convert]::ToByte($mac.substring($_,2),16)}
$packet = (,[byte]255 * 6) + ($target * 16)
$UDPclient = new-Object System.Net.Sockets.UdpClient
[void]$UDPclient.Send($packet, 102) 


Open in new window

On that page it states for "Usage" to pass the argument or parameter like so:
Send-WOL -mac 00:11:32:21:2D:11 -ip -port 7 
Send-WOL -mac 00-11-32-21-2D-11 -ip -port 7 
Send-WOL -mac 0011.3221.2D11 -ip -port 7 
Send-WOL -mac 001132212D11 -ip -port 7 
Send-WOL -mac 001132212D11 

Open in new window

But how do I exactly pass this to the Powershell Function? I am very new to this area. I mainly work in VBA for Access. Do I set up a batch file to run with the argument in it or what?

Thank you all for the help.
Hello ThereSystem AdministratorCommented:
Save it as PS1 -> create a task and let it run.
Dustin StanleyEntrepreneurAuthor Commented:
I have been trying every which way with no luck from the Task Scheduler.  

In Arguments I have Tried:
-ExecutionPolicy Bypass "C:\Users\User 1\Downloads\Send-WOL.ps1" Send-WOL -mac 000000000000
-ExecutionPolicy Bypass "C:\Users\User 1\Downloads\Send-WOL.ps1" Send-WOL -mac 00:00:00:00:00:00 -ip -port 7
-ExecutionPolicy Bypass "C:\Users\User 1\Downloads\Send-WOL.ps1" Send-WOL -mac 00:00:00:00:00:00 -ip
-ExecutionPolicy Bypass C:\Users\User 1\Downloads\Send-WOL.ps1 Send-WOL -mac 00:00:00:00:00:00 -ip -port 7
-ExecutionPolicy Bypass C:\Users\User 1\Downloads\Send-WOL.ps1 Send-WOL -mac 00:00:00:00:00:00 -ip
-ExecutionPolicy Bypass Send-WOL.ps1 Send-WOL -mac 00:00:00:00:00:00

Open in new window

I have tried Start in:
C:\Users\User 1\Downloads\
"C:\Users\User 1\Downloads\"

Open in new window

No luck. With user logged in or with user logged in/out. Highest Privileges....
you modify the example for a WOL on request
to a loop that reads MAC addresses of your systems in a file, and then issues a WOL to each system.
Create a single file, computers_to_wakeup.txt

Never use an IP since it will not be valid when the system is off, the is a broadcast address which is what the WOL packet is destined for the MAC address of the NIC....

A way to read a csv file if you want to include
systemname,MAC address
and have the output reflect issued WOL to systemname Mac address: ...

the data extracted from the file is the loop surrounding the example.

first test the script manually before trying to scheduling it.
i.e. make sure it works, before proceeding to the next step.
Boot the system that is first. then run this script and see if the other system boot.

Many systems have BIOS start options.
You could schedule the boot every morning of the first at 8am as an example, while scheduling the others to boot 10 minutes later.
Dustin StanleyEntrepreneurAuthor Commented:
The code designers remarks are "default UDP port is 9". According to my port 9 is not seen. Do I have to open this port in my router to be able to WOL within my network?  If I do have to open and forward this port then how would I do this on multiple PCs if the single 9 port is forwarded to the 1 PC? Thank you for the help but so far not going so well.
No, it is a broadcast packet addressed to a Mac address, each NIC will identify the packet addressed to it as long as the NIC is powered.

Forwarding etc. applies when the Windows OS is operational and analyzes the network packets passed by the Nic to the kernel network handler.

In this situation the Windows OS is off. The magic packet triggers the NIC to trigger the MB to start the bootup process.
Dustin StanleyEntrepreneurAuthor Commented:
On PC1 is there anywhere I would need to enable something to be able to SEND the magic packets. Like how I had to enable WOL by Magic Packets?

Also here is my system setup currently. I don't know if this will help you any.
no, all you need is the powershell script and the MAC address of the other devices to which you want the packet sent.

In the way you have it, if pc1 and pc2 are on different segments, than you will run into an issue, the magic packet can not cross segment boundaries so if PC1 is on 192.168.0.x/24 and PC2 is on 192.168.2.y/24 you will not be able to wake it up.

The only way would if your gateway supports it, to send the magic packet from the gateway.
Dustin StanleyEntrepreneurAuthor Commented:
so if PC1 is on 192.168.0.x/24 and PC2 is on 192.168.2.y/24
Maybe I'm misunderstanding but both PCs have completely different IP address (IPv4 Address) such as:
PC1 =
PC2 =

Also the gateway and the first switch are basically just a router from the Service provider.

I just want to clarify this before I start thinking a different path. I thank you for the help.
If they are on the same segment, they will see the broadcast which is what a magic packet is.
a.b.c.d is the normal format of the IPv4 IP.
a.b.c.x and a.b.c.y are IPs on the same segment when the network mask is

a.b.c.x and a.b.g.y are systems on different IP segments when both have the same network mask.
the first a magic packet sent from a.b.c.x to the MAC address (ipconfig /all  look at the physical address entry for the local area connection or however you named it on the system you wish to awaken/start)

The second example, because they are on two different segments, the router is the only place from which this packet can be sent to be seen by a system on either network.

I'm still thinking it would be simpler to schedule the systems to boot using the BIOS though if there are days that you do not operate, those systems will be running.

The bootup/shutdown process is greater wear and tear on a system as compared to having it running all the time.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dustin StanleyEntrepreneurAuthor Commented:
Thanks for the help. i am just going to set back up the scheduled power on at a certain time.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking Hardware-Other

From novice to tech pro — start learning today.