简体   繁体   English

Powershell远程访问被拒绝

[英]Powershell Remoting Access Denied

I have enabled PSRemoting on the server: 我已在服务器上启用PSRemoting:

Enable-PSRemoting -Force

I also checked that the port is listening properly on the correct IPs by using the command: 我还使用以下命令检查了端口是否在正确的IP上正确侦听:

winrm enumerate winrm/config/listener

Yet when I try to create a New-PSSession to loopback address: 但是,当我尝试创建一个New-PSSession来回送地址时:

New-PSSession ::1

It gives the following error: 它给出以下错误:

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

Any help in troubleshooting this would be appreciated! 任何帮助解决此问题将不胜感激!

Here is the output for 这是输出

winrm get winrm/config

Not sure if it helps: 不确定是否有帮助:

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

Run the PowerShell as administrator. 以管理员身份运行PowerShell。 Having elevated privileges resolved the issue in my case. 在我的情况下,具有较高的特权可以解决此问题。

The same issue happened with me. 我也遇到了同样的问题。 I was running the Powershell ISE in admin mode, both computers had the correct privileges. 我在管理员模式下运行Powershell ISE,两台计算机都具有正确的特权。 After some investigation, I found out that the time was wrong on the remote system. 经过调查,我发现远程系统上的时间不正确。 Fixed that and I was able to then remote in. 修复了该问题,然后我就可以远程进入了。

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

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