# Error when rebooting Windows server

**URL:** <https://forum.ansible.com/t/error-when-rebooting-windows-server/26417>\
**Category:** Ansible Developer\
**Tags:** windows, awx\
**Created:** [January 4, 2018, 3:31pm UTC](https://forum.ansible.com/t/error-when-rebooting-windows-server/26417 "2018-01-04T15:31:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_B](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@Josh\_B](https://forum.ansible.com/u/Josh_B)\
**Post date:** [January 4, 2018, 3:31pm UTC](https://forum.ansible.com/t/error-when-rebooting-windows-server/26417/1 "2018-01-04T15:31:47Z")

</div>

Hello,

I have a server build yml file that I am using for AWX and at the end I am rebooting the server. When I run that command, I receive this.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: ‘Connection’ object has no attribute ‘\_winrm\_host’

When I run as a single command, it works with no issues. Is it not possible to do this on a server build?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [January 5, 2018, 5:34pm UTC](https://forum.ansible.com/t/error-when-rebooting-windows-server/26417/2 "2018-01-05T17:34:23Z")

</div>

How exactly are you rebooting the server? (share the relevant bit of your playbook).

win\_reboot module call is my current favourite way to do this.

If you don’t care to wait for the reboot to complete and for the machine to come back up, you can just run

- name: final restart  
win\_command: Restart-Computer -Force

Jon
