# Shutting Down Windows with Ansible

**URL:** <https://forum.ansible.com/t/shutting-down-windows-with-ansible/32917>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 12, 2020, 8:53pm UTC](https://forum.ansible.com/t/shutting-down-windows-with-ansible/32917 "2020-05-12T20:53:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Thompson](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeremy\_Thompson](https://forum.ansible.com/u/Jeremy_Thompson)\
**Post date:** [May 12, 2020, 8:53pm UTC](https://forum.ansible.com/t/shutting-down-windows-with-ansible/32917/1 "2020-05-12T20:53:03Z")

</div>

I’m simply wanting to create a playbook that will shutdown a windows computer. I’ve got my ansible server talking to my windows and can ping it, but my playbook gives the below error when trying to run. Any ideas?

Playbook:

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 12, 2020, 8:56pm UTC](https://forum.ansible.com/t/shutting-down-windows-with-ansible/32917/2 "2020-05-12T20:56:15Z")

</div>

I am interest in this as well

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [May 12, 2020, 10:00pm UTC](https://forum.ansible.com/t/shutting-down-windows-with-ansible/32917/3 "2020-05-12T22:00:56Z")

</div>

A few issues

- The output indicates you didn’t supply the command args for shutdown.exe correctly. If the +1 is meant to say shutdown after 1 second the correct syntax is to use /t 1 - [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/shutdown](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/shutdown)
- You need to run the task with async: 60 and poll: 0 so Ansible doesn’t fail when trying to get the output back from the remote host.
