# Win\_ping failing with Correct Credentials

**URL:** <https://forum.ansible.com/t/win-ping-failing-with-correct-credentials/32441>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 11, 2020, 9:22am UTC](https://forum.ansible.com/t/win-ping-failing-with-correct-credentials/32441 "2020-03-11T09:22:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piyush\_Bansal](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@Piyush\_Bansal](https://forum.ansible.com/u/Piyush_Bansal)\
**Post date:** [March 11, 2020, 9:22am UTC](https://forum.ansible.com/t/win-ping-failing-with-correct-credentials/32441/1 "2020-03-11T09:22:46Z")

</div>

Hello All,

I am trying to win\_ping windows server from ansible but it is failing with error that specified credntials are rejected.  
I have cross verified multiple times that group\_vars,inventory,hosts etc files are all correctly updated with abosolutely correct password (I am able to RDP login to the server using these creds) but still it is giving me the error.  
Ansible VM and the windows VM are both in same VLANs. User account does have admin privileges.  
SSL certificates are correctly setup on the windows VM too.  
I have whole setup running fine with these versions and configurations but this one server is really paining.  
Please suggest…!!

Below are the configuration versions and detailed error message.

PS Version: 4.0  
Windows Version: 2008 R2 Standard  
Ansible: 2.6.5  
Python: 2.7.5

ansible group1 -m win\_ping -vvvvv

ansible 2.6.5  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc  
META: ran handlers  
Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win\_ping.ps1  
\<a.b.c.d\> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5986 TO a.b.c.d  
checking if winrm\_host a.b.c.d is an IPv6 address  
\<a.b.c.d\> WINRM CONNECT: transport=ssl endpoint=[https://a.b.c.d:5986/wsman](https://a.b.c.d:5986/wsman)  
\<a.b.c.d\> WINRM CONNECTION ERROR: the specified credentials were rejected by the server  
Traceback (most recent call last):  
File “/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py”, line 399, in \_winrm\_connect  
self.shell\_id = protocol.open\_shell(codepage=65001) # UTF-8  
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 157, in open\_shell  
res = self.send\_message(xmltodict.unparse(req))  
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 234, in send\_message  
resp = self.transport.send\_message(message)  
File “/usr/lib/python2.7/site-packages/winrm/transport.py”, line 260, in send\_message  
response = self.\_send\_message\_request(prepared\_request, message)  
File “/usr/lib/python2.7/site-packages/winrm/transport.py”, line 270, in \_send\_message\_request  
raise InvalidCredentialsError(“the specified credentials were rejected by the server”)  
InvalidCredentialsError: the specified credentials were rejected by the server

a.b.c.d | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ssl: the specified credentials were rejected by the server”,  
“unreachable”: true  
}

Thanks,  
Piyush Bansal  
9650865898

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 14, 2020, 9:59am UTC](https://forum.ansible.com/t/win-ping-failing-with-correct-credentials/32441/2 "2020-03-14T09:59:07Z")

</div>

Could it be that this patch is missing?[https://docs.ansible.com/ansible/latest/user\_guide/windows\_setup.html#winrm-memory-hotfix](https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#winrm-memory-hotfix)

Might be worth checking event log on the machine you are having trouble with.

Worth checking how you are authenticating - ntlm, kerberos, credssp maybe?

Check the winrm configuration as well.

Hope this helps.

Jon

---

<div class="post-metadata">

**Author:** ![Piyush\_Bansal](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@Piyush\_Bansal](https://forum.ansible.com/u/Piyush_Bansal)\
**Post date:** [March 16, 2020, 11:14am UTC](https://forum.ansible.com/t/win-ping-failing-with-correct-credentials/32441/3 "2020-03-16T11:14:03Z")

</div>

Hello Jon,

Thanks for writing to me…!!  
The memory leak hotfix is for PowerShellv3 but I am facing issues with PowerShellv4. Below are the connection variables I am using:  
ansible\_ssh\_port=5986  
ansible\_connection=winrm  
ansible\_winrm\_server\_cert\_validation=ignore  
ansible\_winrm\_transport=ssl

Thanks & Regards,  
Piyush Bansal
