简体   繁体   English

Powershell远程处理突然停止工作

[英]powershell remoting suddenly stops working

I ran this script all day yesterday and then half of the day today. 我昨天整天都运行了此脚本,而今天则运行了一半。 Now suddenly it just hangs for a minute and times out with this error: 现在突然挂了一分钟,并因该错误而超时:

PS C:\Users\me> Invoke-Command -computer devspin -ScriptBlock {$PSVersionTable.PSVersion}

[devspin] Connecting to remote server devspin failed with the following error message : WinRM cannot complete the operation. [devspin]连接到远程服务器devspin失败,并显示以下错误消息:WinRM无法完成该操作。 Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. 验证指定的计算机名称是否有效,可通过网络访问该计算机以及是否已启用WinRM服务的防火墙例外并允许从该计算机进行访问。 By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. 默认情况下,公共配置文件的WinRM防火墙例外将限制对同一本地子网内的远程计算机的访问。 For more information, see the about_Remote_Troubleshooting Help topic. 有关更多信息,请参见about_Remote_Troubleshooting帮助主题。 + CategoryInfo : OpenError: (devspin:String) [], PSRemotingTransportException + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken + CategoryInfo:OpenError:(devspin:String)[],PSRemotingTransportException + FullyQualifiedErrorId:WinRMOperationTimeout,PSSessionStateBroken

I rebooted both (domain) machines, reran remoting setup, there is no firewall. 我重新启动了两个(域)计算机,重新运行了远程设置,没有防火墙。 And on top of that I can run the same command to other machines or from other machines and it works. 最重要的是,我可以对其他计算机或其他计算机运行相同的命令,并且可以正常运行。 It is just these two windows 2012 R2 machines have somehow stopped talking. 只是这两个Windows 2012 R2机器以某种方式停止了通话。

any ideas? 有任何想法吗? thanks 谢谢

Sure glad I went and asked our IT department about this. 我当然很高兴去询问了我们的IT部门。 They said something about how our new switches/hardware vpn don't like the default MTU size windows is set to. 他们说了一些关于我们的新交换机/硬件vpn的不喜欢默认MTU大小窗口设置为的内容。 They said to set it to 1450 and it would work. 他们说将其设置为1450,它将起作用。 I was skeptical, but tried it and BAM! 我对此表示怀疑,但尝试过了,BAM! it work. 这行得通。 Computers, they never cease to confuse me. 电脑,他们永远不会使我困惑。

the command I used was: 我使用的命令是:

netsh interface ipv4 set subinterface 13 mtu=1450 store=persistent netsh接口ipv4设置子接口13 mtu = 1450 store = persistent

But your interface may be different. 但是您的界面可能有所不同。 Hope this helps someone... 希望这可以帮助某人...

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

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