Powershell 输入PSSession不使用端口5986
Powershell 输入PSSession不使用端口5986,powershell,powershell-remoting,powershell-4.0,Powershell,Powershell Remoting,Powershell 4.0,Enter-PSSession命令在端口为5985的远程PC上工作,但每当我指定端口5986(HTTPS)时,它都会显示以下错误: Enter-PSSession : Connecting to remote server localhost failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the
Enter-PSSession
命令在端口为5985的远程PC上工作,但每当我指定端口5986(HTTPS)时,它都会显示以下错误:
Enter-PSSession : Connecting to remote server localhost failed with the
following error message : The client cannot connect to the destination
specified in the request. Verify that the service on the destination is
running and is accepting requests. Consult the logs and documentation for
the WS-Management service running on the destination, most commonly IIS
or WinRM. If the destination is the WinRM service, run the following
command on the destination to analyze and configure the WinRM service:
"winrm quickconfig". For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName localhost -Port 5986
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (localhost:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
我曾尝试在防火墙中启用端口5986,甚至完全禁用防火墙,但仍然无法解决问题。那么,如何为PSSession启用端口5986?我遇到了这个问题
New-SelfSignedCertificate -DnsName <your_server_dns_name_or_whatever_you_like> -CertStoreLocation Cert:\LocalMachine\My
New SelfSignedCertificate-DnsName-CertStoreLocation证书:\LocalMachine\My
winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=”<your_server_dns_name_or_whatever_you_like>”; CertificateThumbprint=”<certificate_thumbprint_from powershell>”}`
winrm set winrm/config/client @{TrustedHosts="<ip_remote_server>"}
winrm创建winrm/config/Listener?地址=*+Transport=HTTPS@{Hostname=“”;CertificateThumbprint=“”}`
$so = New-PsSessionOption –SkipCACheck -SkipCNCheck
Enter-PSSession -ComputerName <ip_address_or_dns_name_of_server> -Credential <local_admin_username> -UseSSL -SessionOption $so
$so=New PsSessionOption–SkipCACheck–skipncheck
输入PSSession-ComputerName-Credential-UseSSL-SessionOption$so
winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname=”<your_server_dns_name_or_whatever_you_like>”; CertificateThumbprint=”<certificate_thumbprint_from powershell>”}`
winrm set winrm/config/client @{TrustedHosts="<ip_remote_server>"}
winrm集winrm/config/client@{TrustedHosts=”“}
这似乎与中的问题相同,只是从不同的角度来看。请在服务器和客户端上显示winrm get winrm/config
的输出。远程计算机是否已配置为对PSRM使用HTTPS?