我试图使用方法:输入-PSSession将返回PSInvalidOperationException
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 -C计算机名'10.10.10.5' - 正式管理员 –