# unable to ping windows machine

**URL:** <https://forum.ansible.com/t/unable-to-ping-windows-machine/33842>\
**Category:** Ansible Project\
**Tags:** windows, ansible-project\
**Created:** [September 17, 2020, 2:25pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842 "2020-09-17T14:25:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [September 17, 2020, 2:25pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/1 "2020-09-17T14:25:15Z")

</div>

> i got the below error when i am trying to ping windows machine  
> i have ran that configurepowershell.ps1 power script also and my winrm service is running successfully nut still facing same issue, please give me a solution for this.
> 
> win2016 | UNREACHABLE! =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
> &nbsp;&nbsp;&nbsp;&nbsp;"msg": "basic: HTTPConnectionPool(host='win2016', port=5985): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(\<urllib3.connection.HTTPConnection object at 0x7f8b2e02ed90\>, 'Connection to 52.168.175.51 timed out. (connect timeout=30)'))",  
> &nbsp;&nbsp;&nbsp;&nbsp;"unreachable": true
> 
> I used the below details for connection in inventory:  
> [windows]  
> win2016
> 
> [windows:vars]  
> ansible\_user=root  
> ansible\_password=password  
> ansible\_connection=winrm  
> ansible\_port=5985  
> ansible\_winrm\_transport=basic  
> ansible\_ssh\_port=5986  
> ansible\_winrm\_server\_cert\_validation=ignore

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Can you ping it from the command line?

---

<div class="post-metadata">

**Author:** ![PRAVEEN\_KATTULAPALLI](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PRAVEEN\_KATTULAPALLI](https://forum.ansible.com/u/PRAVEEN_KATTULAPALLI)\
**Post date:** [September 17, 2020, 2:42pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/2 "2020-09-17T14:42:16Z")

</div>

yes, I did it from command line . i used this command  
ansible all -i hosts -m win\_ping.

got the above error.

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [September 17, 2020, 3:22pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/3 "2020-09-17T15:22:58Z")

</div>

> yes, I did it from command line . i used this command  
> ansible all -i hosts -m win\_ping.
> 
> got the above error.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I meant running the ping command, no ansible involved, from the  
command line, as in

ping win2016.box.somewhere.out.there

If you can't ping using, well, ping don't blame ansible.

---

<div class="post-metadata">

**Author:** ![Kundan\_Singh](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kundan\_Singh](https://forum.ansible.com/u/Kundan_Singh)\
**Post date:** [September 17, 2020, 3:26pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/4 "2020-09-17T15:26:58Z")

</div>

Hi

Insted of root please mention administrator  
And it’s password

**windows:vars]**  
**ansible\_user=adminstrator**

**And check**

---

<div class="post-metadata">

**Author:** ![PRAVEEN\_KATTULAPALLI](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PRAVEEN\_KATTULAPALLI](https://forum.ansible.com/u/PRAVEEN_KATTULAPALLI)\
**Post date:** [September 17, 2020, 3:36pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/5 "2020-09-17T15:36:51Z")

</div>

I have one major doubt  
Ansible\_user:  
Ansible\_password:

What does these two commands represent?.

Do they represent windows credentials or the user credentials from which you want to ping windows machine.

---

<div class="post-metadata">

**Author:** ![Kundan\_Singh](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kundan\_Singh](https://forum.ansible.com/u/Kundan_Singh)\
**Post date:** [September 17, 2020, 3:39pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/6 "2020-09-17T15:39:25Z")

</div>

Yes these are endpoint credential for user

---

<div class="post-metadata">

**Author:** ![PRAVEEN\_KATTULAPALLI](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PRAVEEN\_KATTULAPALLI](https://forum.ansible.com/u/PRAVEEN_KATTULAPALLI)\
**Post date:** [September 17, 2020, 3:58pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/7 "2020-09-17T15:58:25Z")

</div>

Sorry for asking again end point credentials means windows…

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [September 17, 2020, 4:03pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/8 "2020-09-17T16:03:43Z")

</div>

> Sorry for asking again end point credentials means windows..

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;He meant whatever WIndows user you want ansible to use to login  
to this win2016 box.

---

<div class="post-metadata">

**Author:** ![PRAVEEN\_KATTULAPALLI](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@PRAVEEN\_KATTULAPALLI](https://forum.ansible.com/u/PRAVEEN_KATTULAPALLI)\
**Post date:** [September 18, 2020, 2:18pm UTC](https://forum.ansible.com/t/unable-to-ping-windows-machine/33842/9 "2020-09-18T14:18:34Z")

</div>

Hii all,

well

thanks for your help. resolved!!

As previously someone communicated, before try to ping windows vm from ansible needs to check whether it is pinging from other windows or linux machine by using ping ip command.
