Usually when I've seen that error, it's because Powershell is not on the 
system path (ie, C:\Windows\System32\WindowsPowerShell\v1.0). Unfortunately 
the error message comes from a much higher level (a failure creating the 
tempdir), so the error message isn't specific to failures that might occur 
on Windows (hence the somewhat misleading text). 

On Thursday, October 13, 2016 at 8:10:33 AM UTC-7, 
> Hi
> When run this ansible command " ansible windows  -m win_ping"  I am  
> getting the below error , please can anyone help to fix this issue
>     "changed": false,
>     "msg": "Authentication or permission failure. In some cases, you may 
> have been able to authenticate and did not have permissions on the remote 
> directory. Consider changing the remote temp path in ansible.cfg to a path 
> rooted in \"/tmp\". Failed command was: PowerShell -NoProfile 
> -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand 
> exited with result 1",
>     "unreachable": true
> }
> I am trying to connect to windows (windows 2012 R2) host ip
> I have created a windows.yml  under /etc/ansible/group_vars  , below is 
> the connect of the yml file , in my inventory file I have added the ip of 
> this windows host
> ansible_user: Administrator
> ansible_password: P@ssw0rd
> ansible_port: 5986
> ansible_connection: winrm
> # The following is necessary for Python 2.7.9+ when using default WinRM 
> self-signed certificates:
> ansible_winrm_server_cert_validation: ignore
> #ansible_winrm_transport: ssl
> using this same setting I am able to ping to another windows machine which 
> is also windows server 2012
> Thanks
> Arnab Chowdhury

You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Reply via email to