修复:WinRM无法改变配置
没有.
This error typically occurs when you try to enable or configure the Windows Remote Management (WinRM) service using the winrm quickconfig 或是 Enable-PSRemoting commands. Windows blocks the configuration change because the network location type for one or more of your active network adapters is set to Public.
By default, Windows security policies prohibit WinRM from creating firewall exceptions on public networks to protect your system from unauthorized remote access. To resolve this, you must change your network profile to Private 或命令 WinRM 跳过网络配置文件检查.
逐步修复问题
方法1:将网络配置文件更改为私有 (推)
这是最安全和最永久的解决方案.它告诉Windows,你信任你连接的网络.
- 按下右键 Start menu 按和选择 Windows Terminal (Admin) 或是 PowerShell (Admin).
- View your current network adapters and their categories by typing the following command, then press Enter:
Get-NetConnectionProfile - 看看这个 NetworkCategory 如果它说 Public,注意名字列在旁边. Name.
- 通过执行下面的命令将网络类别更改为私有
YourNetworkName以前一步的实际名称):Set-NetConnectionProfile -Name "YourNetworkName" -NetworkCategory Private - 重新运行您的原始 WinRM 配置命令:
winrm quickconfig
方法2:使用SkipNetworkProfileCheck参数
如果您正在使用Windows PowerShell,并且想要在不改变网络设置的情况下强制配置,您可以绕过防火墙限制检查.
- 打开 PowerShell (Admin).
- 使用特殊绕行标志执行启用命令,键入:
Enable-PSRemoting -SkipNetworkProfileCheck -Force - 这个命令配置WinRM运行并创建必要的本地防火墙规则,同时忽略公共网络状态.
方法3:重新启动 WinRM 服务
有时服务配置会被锁定在等待状态,需要手动更新.
- 按下 Windows Key + R 打开运行对话框.
- 它们的类型
services.msc然后按下. Enter. - 在列表中向下滚动查找. Windows Remote Management (WS-Management).
- 右键点击它并选择 Restart 如果它没有运行,点击 Start.
- 双击服务,更改 Startup type 为了 Automatic 然后点击 OK.
- 在命令行中重新尝试您的 WinRM 设置.
可能有一些错误.. Learn Microsoft