Ansible on Windows w/o administrator privileges possible?

Hello,

Is it possible to use a non-administrator user to run Ansible against Windows hosts and if yes, how?

I’ve used invoke-command -computername localhost -credential ansible -scriptblock {$env:computername} to test inside Powershell, which works fine only if the Ansible user is Administrator.

What did not help it:

  • Add user to Windows Remote management group
  • Add user to Windows Remote management and WinRMRemoteWMIUsers__ group

Test target is this SRV2012R2 vagrant box: https://atlas.hashicorp.com/mwrock/boxes/Windows2012R2

Regards
Avaro Aleman

Yes, it’s absolutely possible. Usually the limiting factor on a default install is the WinRM listener ACL- you can see/alter this via:

winrm configSDDL default

and add the necessary users/groups (or add the existing Windows Remote Management group).

(typical cases only need the “read” and “execute” permission)

That did the trick, thanks!