This commit is contained in:
2020-06-22 10:57:58 -04:00
parent 793c57d6b1
commit ee28e6f132
2 changed files with 52 additions and 15 deletions
+13
View File
@@ -0,0 +1,13 @@
## Target MAC address
$Mac = "f8:bc:12:83:ce:3e"
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"}
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16)
Try
{
$UdpClient = New-Object System.Net.Sockets.UdpClient
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7)
$UdpClient.Send($MagicPacket,$MagicPacket.Length)
$UdpClient.Close()
}
Catch { Write-Output $_.Exception.Message }