简体   繁体   English

WOL 在 Powershell 之外工作

[英]WOL works outside of Powershell

Regardless of what Script I use I can not get PowerShell 5.1 to trigger a boot on my Hyper-V Host.无论我使用什么脚本,我都无法让 PowerShell 5.1 在我的 Hyper-V 主机上触发启动。

I can use the solarwinds WakeonLan tool to boot the server, but I would like to find a solution that would work natively.我可以使用 solarwinds WakeonLan 工具来启动服务器,但我想找到一个可以在本地工作的解决方案。

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我尝试了许多我在网上找到的脚本,作为最后的努力,我安装了“ WakeOnLAN 1.0 ”模块,但是虽然它说它执行成功,但服务器没有启动

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?什么可能导致服务器仅使用 SolarWinds WakeOnLan.exe 启动,而不是在 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.因为它可能是相关的,我试图从中发送 MagicPacket 的计算机是 MultiNic 机器,但在 Hyper-V 服务器的子网上只有 1 个 NIC 是 IP 的。

Other Scripts I attempted to use:我尝试使用的其他脚本:

Here is the solution, tested on an AD WK2016 with windows10 stations这是解决方案,在带有 windows10 站的 AD WK2016 上进行了测试

https://community.spiceworks.com/topic/2195715-wol-and-powershell https://community.spiceworks.com/topic/2195715-wol-and-powershell

Something like this works for me with remote powershell, going to the same subnet the down computers are on.像这样的东西对我来说适用于远程 powershell,进入停机计算机所在的同一子网。 Fast startup also has to be disabled in the windows 10 registry (HiberbootEnabled=0).还必须在 windows 10 注册表中禁用快速启动 (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])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM