无法使用powershell连接到远程pc
我使用powershell从一台计算机连接到另一台远程计算机 为此,我根据以下视频在两台计算机上进行了一些配置: 但当我尝试在本地计算机上执行此操作时,仍然会收到一条错误消息:无法使用powershell连接到远程pc,powershell,server,remote-access,Powershell,Server,Remote Access,我使用powershell从一台计算机连接到另一台远程计算机 为此,我根据以下视频在两台计算机上进行了一些配置: 但当我尝试在本地计算机上执行此操作时,仍然会收到一条错误消息: enter-pssession -comp remotePC -credential domain\username 然后我输入密码并按enter键 我得到这个错误: 连接到远程服务器LocalPC失败,错误消息如下: The WS-Management service cannot process the req
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
“Windows远程管理”-服务在远程PC上启动
我在远程PC上完全禁用了防火墙以进行测试
我还启用了psremoting,并设置了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\
输出中看到的:
键入名称SourceOfValue值
---- ---- ------------- -----
System.String AllowRemoteShellAccess GPO false
WS-Management配置属性
AllowRemoteShellAccess
具有值false
和源GPO
。这意味着:应用于目标计算机的组策略不允许远程shell访问。关于dir WSMan:\localhost\shell\
?请参阅更新2以获取我的答案@PetSerAlAs,您可以看到:System.String allowremoteshell访问GPO false
-您的组策略不允许远程shell访问。