gpt4 book ai didi

windows - WinRM 连接问题?

转载 作者:可可西里 更新时间:2023-11-01 10:41:42 44 4
gpt4 key购买 nike

我正在尝试使用公司网络中的公司服务器创建 Enter-PSSession。我可以 RDC 到服务器,ping 服务器,还可以使用 Get-Service -ComputerName DBServer 获取 Windows 服务状态。但是,WinRM session 不允许我进入服务器。

我的电脑:

  • Windows 10
  • Powershell 5.0
  • IP: 128.2.60.102

服务器:

  • Windows 服务器 2012
  • PowerShell 4.0
  • IP: 10.1.130.1

在数据库服务器上:

PS C:\Windows\system32> winrm e winrm/config/listernerWSManFault    Message        ProviderFault            WSManFault                Message = The WS-Management service cannot process the                          request. The resource URI does not support the                          Enumerate operation.Error number:  -2144108495 0x80338031The WS-Management service cannot process the request because the WS-Addressing Action URI in the request is not compatible with the resource.PS C:\Windows\system32> winrm quickconfigWinRM service is already running on this machine.WinRM is already set up for remote management on this computer.PS C:\Windows\system32> winrm get winrm/configConfig    MaxEnvelopeSizekb = 500    MaxTimeoutms = 60000    MaxBatchItems = 32000    MaxProviderRequests = 4294967295    Client        NetworkDelayms = 5000        URLPrefix = wsman        AllowUnencrypted = false        Auth            Basic = true            Digest = true            Kerberos = true            Negotiate = true            Certificate = true            CredSSP = false        DefaultPorts            HTTP = 5985            HTTPS = 5986        TrustedHosts    Service        RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)        MaxConcurrentOperations = 4294967295        MaxConcurrentOperationsPerUser = 1500        EnumerationTimeoutms = 240000        MaxConnections = 300        MaxPacketRetrievalTimeSeconds = 120        AllowUnencrypted = false        Auth            Basic = false            Kerberos = true            Negotiate = true            Certificate = false            CredSSP = false            CbtHardeningLevel = Relaxed        DefaultPorts            HTTP = 5985            HTTPS = 5986        IPv4Filter = *        IPv6Filter = *        EnableCompatibilityHttpListener = false        EnableCompatibilityHttpsListener = false        CertificateThumbprint        AllowRemoteAccess = true    Winrs        AllowRemoteShellAccess = true        IdleTimeout = 7200000        MaxConcurrentUsers = 10        MaxShellRunTime = 2147483647        MaxProcessesPerShell = 25        MaxMemoryPerShellMB = 1024        MaxShellsPerUser = 30

在客户端(我的机器):

PS C:\windows\system32> Test-WSMan -ComputerName "DBServer"Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859046" Machine="MyMachine"><f:Message>WinRM cannotcomplete the operation. Verify that the specified computer name is valid, thatthe computer is accessible over the network, and that a firewall exception forthe WinRM service is enabled and allows access from this computer. By default,the WinRM firewall exception for public profiles limits access to remotecomputers within the same local subnet. </f:Message></f:WSManFault>At line:1 char:1+ Test-WSMan -ComputerName "DBServer"+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidOperation: (DBServer:String) [Test-WSMan], InvalidOperationException    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommandPS C:\windows\system32> winrm e winrm/config/listenerListener    Address = *    Transport = HTTP    Port = 5985    Hostname    Enabled = true    URLPrefix = wsman    CertificateThumbprint    ListeningOn = 127.0.0.1, 128.1.60.202, ::1PS C:\windows\system32> winrm quickconfigWinRM service is already running on this machine.WinRM is already set up for remote management on this computer.

WinRM 的防火墙端口为 HTTP 和 HTTPS 打开。

谁能帮忙解决这个问题?

最佳答案

注意:以下可能不是您问题的根本原因,但它解释了您在服务器 上看到的错误消息,该消息含糊不清并且值得解释(一个简单的错字也让我感到困惑并把我带到这里)。


您在传递给服务器上的 winrm e 的资源 URI 中有一个拼写错误:

winrm e winrm/config/listerner  # note the extra "r"

应该是:

winrm e winrm/config/listener

不幸的是,**对不存在的资源 URI 的引用会导致以下神秘错误消息:

WSManFault
Message
ProviderFault
WSManFault
Message = The WS-Management service cannot process the request. The resource URI does not support the Enumerate operation.

Error number: -2144108495 0x80338031
The WS-Management service cannot process the request because the WS-Addressing Action URI in the request is not compatible with the resource.

关于windows - WinRM 连接问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51257356/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com