You can see a very useful script on the MS official blog to remotely Wake up the system. 1. check whether your system supports remote wakeup. # ethtooletho | grep 'wake-on 'ortortswake-on: pumbagWake-on: gg indicates it has been started. 2. write a script ####################### param ($ Mac
The official MS blog shows a very practical script to remotely wake up the system.
1. check whether your system supports remote wakeup.
# Ethtool etho | grep 'ake-on'
Supports Wake-on: pumbag
Wake-on: g
G indicates that the instance has been started.
2. write scripts
########################
Param ($ MacAddress)
Echo "Wake up $ MacAddress Now !"
[Byte [] $ MagicPacket = 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
$ MagicPacket + = ($ MacAddress. split ('-') | foreach {[byte] ('0x '+ $ _)}) * 16
$ UdpClient = New-Object System. Net. Sockets. UdpClient
$ UdpClient. Connect ([System. Net. IPAddress]: Broadcast), 9)
$ UdpClient. Send ($ MagicPacket, $ MagicPacket. length)
########################
Save as wakeup. ps1
3. test
Ps d: programmepowershell> ping 192.168.1.188-n 1;. wakeup. ps1 00-16-11-11-11
-11; ping 192.168.1.188-n 3
Pinging 192.168.1.188 with 32 bytes of data:
Request timed out. <-- the system is suspended.
Ping statistics for 192.168.1.188:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss ),
Wake up 00-16-d3-c6-bd-25 Now!
102
Pinging 192.168.1.188 with 32 bytes of data:
Request timed out.
Reply from 192.168.1.188: bytes = 32 time = 1 ms TTL = 64
Reply from 192.168.1.188: bytes = 32 time <1 ms TTL = 64 <-- success