# Executing a command remotely using ansible

**URL:** <https://forum.ansible.com/t/executing-a-command-remotely-using-ansible/20747>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 2, 2016, 2:39pm UTC](https://forum.ansible.com/t/executing-a-command-remotely-using-ansible/20747 "2016-03-02T14:39:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akash\_John](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Akash\_John](https://forum.ansible.com/u/Akash_John)\
**Post date:** [March 2, 2016, 2:39pm UTC](https://forum.ansible.com/t/executing-a-command-remotely-using-ansible/20747/1 "2016-03-02T14:39:35Z")

</div>

Hi Team,

I would like to execute a command on a remote windows host as we are performing on Linux Machines _ansible webserver -s -m shell -a “/etc/init.d/httpd status” -u user1 -k_

Some could you please help me how can we execute the command on Windows remote host. Most probably we need to find a module to replace shell on the above mentioned command line.

Could you please guide me how can we achieve this?

Thanks,  
Akash John

---

<div class="post-metadata">

**Author:** ![Jeff\_L](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jeff\_L](https://forum.ansible.com/u/Jeff_L)\
**Post date:** [March 2, 2016, 2:50pm UTC](https://forum.ansible.com/t/executing-a-command-remotely-using-ansible/20747/2 "2016-03-02T14:50:27Z")

</div>

Have you looked at this? [http://docs.ansible.com/ansible/intro\_windows.html](http://docs.ansible.com/ansible/intro_windows.html)

---

<div class="post-metadata">

**Author:** ![Akash\_John](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Akash\_John](https://forum.ansible.com/u/Akash_John)\
**Post date:** [March 2, 2016, 4:01pm UTC](https://forum.ansible.com/t/executing-a-command-remotely-using-ansible/20747/3 "2016-03-02T16:01:15Z")

</div>

Hi Jeff, yes but i think there we cannot find the similar method as i shared earlier for linux. Could you please guide me if I missed anything on that page?
