# Which module can I use to run command on command prompt on all my hosts ?

**URL:** <https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067>\
**Category:** Ansible Project\
**Created:** [June 1, 2020, 6:45pm UTC](https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067 "2020-06-01T18:45:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [June 1, 2020, 6:45pm UTC](https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067/1 "2020-06-01T18:45:20Z")

</div>

Hi,  
Which module can I use as a task to run a command on the command prompt on all my hosts?

example -

cmd: gpupdate/force

Thanks,

---

<div class="post-metadata">

**Author:** ![nschende](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nschende/32/1681_2.png) [@nschende](https://forum.ansible.com/u/nschende)\
**Post date:** [June 1, 2020, 6:56pm UTC](https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067/2 "2020-06-01T18:56:25Z")

</div>

[https://docs.ansible.com/ansible/latest/modules/win\_command\_module.html#win-command-module](https://docs.ansible.com/ansible/latest/modules/win_command_module.html#win-command-module)

---

<div class="post-metadata">

**Author:** ![nschende](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nschende/32/1681_2.png) [@nschende](https://forum.ansible.com/u/nschende)\
**Post date:** [June 1, 2020, 6:58pm UTC](https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067/3 "2020-06-01T18:58:15Z")

</div>

Since you mentioned gpupdate, then I assumed windows. Ultimately the best place to look to figure out what you can use is to search the all module index:

[https://docs.ansible.com/ansible/latest/modules/list\_of\_all\_modules.html](https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html)

most, if not all of the windows stuff has win\_

---

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [June 1, 2020, 7:07pm UTC](https://forum.ansible.com/t/which-module-can-i-use-to-run-command-on-command-prompt-on-all-my-hosts/33067/4 "2020-06-01T19:07:09Z")

</div>

Thank you for explaining. It is very helpful!

Cheers,
