WOL works outside of Powershell

2.2k Views Asked by At

Regardless of what Script I use I can not get PowerShell 5.1 to trigger a boot on my Hyper-V Host.

I can use the solarwinds WakeonLan tool to boot the server, but I would like to find a solution that would work natively.

I tried many scripts I had found online and as a last ditch effort, I installed the "WakeOnLAN 1.0" Module but while it says it executes successfully the server does not boot

PS C:\WINDOWS\system32> Invoke-WakeOnLan 52:a4:4c:52:d7:52 -Verbose
VERBOSE: Wake-on-Lan Packet sent to 52:a4:4c:52:d7:52

What could cause the server only to boot with the SolarWinds WakeOnLan.exe but not natively in Powershell?

As it may be relevant the computer I am attempting to send the MagicPacket from is a MultiNic Machine but only 1 NIC is IP'd on the subnet of the Hyper-V server.

Other Scripts I attempted to use:

1

There are 1 best solutions below

0
js2010 On

Something like this works for me with remote powershell, going to the same subnet the down computers are on. Fast startup also has to be disabled in the windows 10 registry (HiberbootEnabled=0).

$mac = @{comp002 = '00:11:22:33:44:55'; comp003 = '00:11:22:33:44:56'}
$compsDown = 'comp002','comp003'
# (,) is silly workaround to pass array as invoke-command arguments
icm comp001 invoke-wakeonlan.ps1 -args (,$mac[$compsDown])