无法使用Powershell连接到远程PC

伊丽莎白

我使用Powershell从一台计算机连接到另一台远程计算机。

为此,我根据此视频在两台计算机上进行了一些配置:

https://technet.microsoft.com/zh-cn/itmanagement/ff765030.aspx

但是当我尝试在本地计算机上执行此操作时,仍然收到错误消息:

enter-pssession -comp remotePC -credential domain\username

然后输入密码,然后按Enter。

我收到此错误:

连接到远程服务器LocalPC失败,并显示以下错误消息:

 The WS-Management service cannot process the request. The 
service is configured to not accept any remote shell requests. For more 
CategoryInfo : OpenError: (LocalPC:String) [], PSRemotingTrans
portException + FullyQualifiedErrorId : RemoteSessionDisallowed,PSSessionStateBroken

在远程PC上启动“ Windows远程管理”服务。

我完全在远程PC上完全禁用了防火墙以进行测试。

我也做了enable-psremotingSet-Item WSMan:\localhost\Client\TrustedHosts*

在远程PC上执行时:

winrm config 它说:

WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.

我仍然需要启用那1000件事中的哪些功能,才能使用Powershell连接到远程PC?

更新

PS C:\Windows\system32> winrm get winrm/config/service

Service
    RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;
    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


PS C:\Windows\system32> winrm e winrm/config/listener

Listener
    Address = *
    Transport = HTTP
    Port = 5985
    Hostname
    Enabled = true
    URLPrefix = wsman
    CertificateThumbprint
    ListeningOn = xx.xx.xx.xx, 127.0.0.1, ::1, fe80::4c2c:a8d0:6046:764d%11

更新2

PS C:\Windows\system32> dir WSMan:\localhost\Shell\


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess         GPO             false
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             10
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           25
System.String   MaxMemoryPerShellMB                            1024
System.String   MaxShellsPerUser                               30
用户名

dir WSMan:\localhost\Shell\输出中可以看到

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess         GPO             false

WS-Management配置属性AllowRemoteShellAccessfalsesource具有价值GPO这意味着:应用于目标计算机的组策略确实不允许远程外壳程序访问。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法使用 powershell 远程连接到 Azure VM

来自分类Dev

无法通过工作远程连接到家用PC

来自分类Dev

无法连接到使用静态IP的PC

来自分类Dev

远程PC,Office PC连接到TFS

来自分类Dev

无法连接到远程JMX

来自分类Dev

无法连接到远程MQ

来自分类Dev

硬盘无法连接到PC

来自分类Dev

无法使用PYODBC连接到网络外部的远程SQL Server

来自分类Dev

无法使用psycopg2连接到远程PostgreSQL

来自分类Dev

使用MySQLWorkbench无法连接到(远程)MySQL数据库

来自分类Dev

无法使用XMPPFramework连接到远程服务器

来自分类Dev

无法使用远程桌面连接到Windows 10 VM

来自分类Dev

使用MySQLWorkbench无法连接到(远程)MySQL数据库

来自分类Dev

无法使用JDBC连接到远程Oracle数据库

来自分类Dev

无法使用 cqlsh 连接到 Cassandra 远程主机

来自分类Dev

无法使用凭据连接到远程 SOAP 服务

来自分类Dev

VSCode:无法使用远程开发扩展连接到 Docker 容器

来自分类Dev

通过路由器无法在Mac和Windows PC之间远程连接到PostgreSQL

来自分类Dev

无法远程连接到SQL Server实例

来自分类Dev

无法远程连接到dockerized的mysql db

来自分类Dev

无法连接到远程JMX主机

来自分类Dev

无法从Titan连接到远程Cassandra

来自分类Dev

无法连接到远程MySQL Server(10061)

来自分类Dev

无法远程连接到数据库

来自分类Dev

无法连接到远程JMX主机

来自分类Dev

洪水无法连接到远程种子箱

来自分类Dev

无法连接到远程桌面

来自分类Dev

无法从Titan连接到远程Cassandra

来自分类Dev

Docker 容器无法连接到远程 SQL