Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

powershell - test-wsman works but enter-pssession fails

I am trying to open a remote powershell session on server2 from server1(both of them in the same domain). When I try to run the following command from server1:

Enter-pssession -computername server2 -Credential $cred

I get the following error:

Enter-pssession : Connecting to remote server server2 failed with the following error message : The WSMan service 
could not launch a host process to process the given request. Make sure the WSMan provider host server and proxy are 
properly registered. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : InvalidArgument: (server2:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

But running the test-wsman command gives:

Test-WSMan -ComputerName server2 -Credential $cred -Authentication Kerberos

wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 10.0.17763 SP: 0.0 Stack: 3.0

Can't figure out the issue. Have tried Enable-PSRemoting and checked $PSSessionOption for proxy.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...