Я пытаюсь подключиться к серверу Windows с сервера Ansible control Linux. Я выполнил все шаги, которые вы предложили в моей пьесе.
Case1: при попытке использовать свое имя пользователя и пароль я могу запустить скрипт powershell в windows machine
Case2: пробовал с технической учетной записью, получаю ошибку. Сведения об ошибке вставлены ниже.
fatal: [linux_server]: FAILED! => {"changed": true, "cmd": "$password = \"password" | ConvertTo-SecureString -asPlainText -Force\n $username = \"admin\\username\"\n $credential = New-Object System.Management.Automation.PSCredential($username,$password)\n cd D:\\Risk_AppServer\\test\\\n Invoke-Command -ComputerName windows_server -FilePath .\\sample_ps1.ps1 -credential $credential", "delta": "0:00:00.843081", "end": "2018-09-19 06:31:56.239923", "msg": "non-zero return code", "rc": 1, "start": "2018-09-19 06:31:55.396841", "stderr": "[windows_server] Connecting to remote server windows_server failed with the following error message : Acce\r\nss is denied. For more information, see the about_Remote_Troubleshooting Help topic.\r\n + CategoryInfo : OpenError: (windows_server:String) [], PSRemotingTransportException\r\n + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken", "stderr_lines": ["[windows_server] Connecting t**o remote server windows_server failed with the following error message : Acce", "ss is denied. For more information, see the about_Remote_Troubleshooting Help topic.", " + CategoryInfo : OpenError: (windows_server:String) [**], PSRemotingTransportException", " + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken"], "stdout": "", "stdout_lines": []}
Пожалуйста, обратите внимание: с помощью имени пользователя и пароля технической учетной записи я могу успешно войти в систему Windows.