Closed teridon closed 3 years ago
This is not the location for the documentation. This page is completely separate from the psexec module in Ansible.
If you want to clarify the docs a bit more feel free to send a PR to https://github.com/ansible-collections/community.windows for the file https://github.com/ansible-collections/community.windows/blob/main/plugins/modules/psexec.py.
It's not obvious to new users of this module that one must use "localhost" to connect -- esp. because Windows does not include python by default.
Perhaps in the "Notes" section: "Unless the remote Windows host has python installed, you probably need to use 'localhost' in your ad-hoc command or playbook"
maybe even include an example ad-hoc command?
ansible localhost -m community.windows.psexec -a "hostname=windowshost connection_username=Administrator connection_password='thepassword' executable=cmd.exe arguments='/c echo Hello World'"