我正在尝试使用:
Enter-PSSession -ComputerName 10.10.10.5 -Credential administrator
这给了我:
Enter-PSSession : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Enter-PSSession -ComputerName 10.10.10.5 -Credential administrator ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (10.10.10.5:String) [Enter-PSSession], PSInvalidOperationException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Ansible 同时工作没有问题:
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
<10.10.10.5> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 10.10.10.5
<10.10.10.5> WINRM CONNECT: transport=ssl endpoint=https://10.10.10:5986/wsman
<10.10.10.5> WINRM OPEN SHELL: 5001549B-C9A9-41FF-B9A3-8D19155EE123
EXEC (via pipeline wrapper)
<10.10.10.5> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Unrestricted', '-']
<10.10.10.5> WINRM RESULT u'<Response code 1, out "{"changed":false,"an", err "\r\n">'
<10.10.10.5> WINRM CLOSE SHELL: 5001549B-C9A9-41FF-B9A3-8D19155EE123
有什么方法可以调试吗?
最佳答案
-ComputerName 正在寻找一个字符串。
Enter-PSSession -ComputerName '10.10.10.5' -Credential administrator
'10.10.10.5' 现在将具有 System.String 的 TypeName
谢谢,蒂姆。
关于linux - 输入-PSSession 返回 PSInvalidOperationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46706618/