# Problems with Ansible and WinRM

**URL:** <https://forum.ansible.com/t/problems-with-ansible-and-winrm/30222>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [April 30, 2019, 9:08am UTC](https://forum.ansible.com/t/problems-with-ansible-and-winrm/30222 "2019-04-30T09:08:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Sanchez](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Bryan\_Sanchez](https://forum.ansible.com/u/Bryan_Sanchez)\
**Post date:** [April 30, 2019, 9:08am UTC](https://forum.ansible.com/t/problems-with-ansible-and-winrm/30222/1 "2019-04-30T09:08:53Z")

</div>

Hello AnsibleProjectForum, im trying to deploy ansible with winrm module.

First thing, sorry for my english, im not native english speaker.

Im launching Ansible from Ubuntu to Windows. I have installed the necessary module ( with **_pip install “pywinrm\>=0.3.0”_** ).

My purpose is to create a playbook that allow me to deploy and configure a winlogbeat in a remote windows machine.

For that im trying to connect using user and password with Basic authentication method.

I have nothing at the moment that tells me im connecting correctly, just trying to do a win\_ping with ansible command and doesn’t work.

The command is: _ **ansible GROUPNAME -m wing\_ping -i INVENTORY/PATH -k** _

This is the inventory file:

**[GROUP]**  
**172.22.1.129**  
**[GROUP:vars]**  
**ansible\_user=LocalUsername**  
**ansible\_password=Password**  
**ansible\_connection=winrm**  
**ansible\_winrm\_transport=basic**  
**ansible\_port=(im testing between 5985 and 5986 ).**

Looking aroung the Internets i found that i can use this variable when im trying to connect via https (port 5986) : **ansible\_winrm\_server\_cert\_validation=ignore** (because it is looking up for a certificate and i dont want to do it by certificate method).

Ansible always says that the server rejected the credentials:

**_172.22.1.129 | UNREACHABLE! =\> {_**  
**_“changed”: false,_**  
**_“msg”: “ssl: the specified credentials were rejected by the server”,_**  
**_“unreachable”: true_**  
**_}_**

Note that the normal ping works.

Can you guys help me out? If you can handle some code examples it would be handy.

Thank you and sorry again for my English.

Cheers!

---

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [April 30, 2019, 9:49am UTC](https://forum.ansible.com/t/problems-with-ansible-and-winrm/30222/2 "2019-04-30T09:49:51Z")

</div>

Can you try adding the following as well and test:

**ansible\_winrm\_message\_encryption: auto**

---

<div class="post-metadata">

**Author:** ![Bryan\_Sanchez](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Bryan\_Sanchez](https://forum.ansible.com/u/Bryan_Sanchez)\
**Post date:** [April 30, 2019, 11:02am UTC](https://forum.ansible.com/t/problems-with-ansible-and-winrm/30222/3 "2019-04-30T11:02:11Z")

</div>

Hello Ankit, that didn’t fix the problem, but my enterprise gave me access to its domain.  
Didnt knew they were on domain at first, so i connected via Kerberos and now it works!

Thanks for the fast reply.  
Cheers!
