如何将 Windows 2008 R2 机器上的 WinRM 恢复到“开箱即用”状态?或者,我如何让 WinRM 再次开始与我交谈?
我通过 RDP 以管理员身份登录。任何访问或配置 winrm 的尝试都会遇到拒绝访问。
我还有其他 3 台 WinRM 可以正常工作的服务器。
在过去 2 个月的某个时间点,WinRM 在第四台服务器上变得无法访问。
我花了大约 2 天的时间阅读、研究和尝试不同的方法来让 WinRM 再次工作。这里有几个:
- 帮助 about_Remote_Troubleshooting
- Jonathan Jordan 的 WinRM 故障排除帖子
- PowerShell 远程处理指南
- 一堆这些谷歌点击
- 这些答案都没有重复解决我的问题,他们也没有回答我关于如何将 WinRM 重置为默认安装状态的问题。
LocalAccountTokenFilterPolicy 设置为 1
所有服务器的防火墙规则都相同。
Windows 远程管理服务已启动并正在运行。
以下是我使用各种命令看到的一些示例:
PS C:\> winrm id IdentifyResponse
ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor = Microsoft Corporation
ProductVersion = OS: 6.1.7601 SP: 1.0 Stack: 2.0
winrm 快速配置
PS C:\> winrm quickconfig
WinRM already is set up to receive requests on this machine.
WSManFault
Message = Access is denied.
Error number: -2147024891 0x80070005
winrm 枚举 winrm/config/listener
PS C:\> winrm enumerate winrm/config/listener
WSManFault
Message = Access is denied.
Error number: -2147024891 0x80070005
Access is denied.
设置-PSSessionConfiguration Microsoft.Powershell -ShowSecurityDescriptorUI
Performing operation "Set-PSSessionConfiguration" on Target "Name: Microsoft.PowerShell".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Access is denied.
At line:15 char:26
+ if ((!$pluginName) -or <<<< !(test-path "$pluginDir"))
+ CategoryInfo : InvalidOperation: (:) [], InvalidOperationException
+ FullyQualifiedErrorId : WsManError
Join-Path : Access is denied.
At line:22 char:35
+ $pluginFileNamePath = Join-Path <<<< "$pluginDir" 'FileName'
+ CategoryInfo : NotSpecified: (:) [Join-Path], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.JoinPathCommand
Test-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At line:23 char:19
+ if (!(test-path <<<< "$pluginFileNamePath"))
+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Test
PathCommand
Get-Item : Cannot bind argument to parameter 'LiteralPath' because it is an empty string.
At line:29 char:43
+ $pluginFileName = get-item -literalpath <<<< "$pluginFileNamePath"
+ CategoryInfo : InvalidData: (:) [Get-Item], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.GetI
temCommand
Set-PSSessionConfiguration : Session Configuration "Microsoft.PowerShell" is not a PowerShell based shell.
At line:89 char:27
+ Set-PSSessionConfiguration <<<< $args[0] $args[1] $args[2] $args[3] $args[4] $args[5] $args[6] $args[7] $args[8]
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-PSSessionConfiguration
和服务器管理器