Powershell远程访问被拒绝

时间:2017-05-25 07:42:01

标签: powershell powershell-remoting

我在服务器上启用了PSRemoting:

Enable-PSRemoting -Force

我还使用以下命令检查端口是否正确侦听了正确的IP:

winrm enumerate winrm/config/listener

然而,当我尝试创建一个New-PSSession来回送地址时:

New-PSSession ::1

它出现以下错误:

New-PSSession : [[::1]] Connecting to remote server [::1] failed with the following error message : Access is denied.
For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession ::1
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: 
(System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

任何有关排除故障的帮助都将不胜感激!

这是

的输出
winrm get winrm/config

不确定是否有帮助:

Config
    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

2 个答案:

答案 0 :(得分:0)

以管理员身份运行PowerShell。提升权限解决了我的问题。

答案 1 :(得分:0)

我也遇到了同样的问题。我在管理员模式下运行Powershell ISE,两台计算机都具有正确的特权。经过调查,我发现远程系统上的时间不正确。解决该问题,然后我就可以远程进入了。