# Is there a better way to do this: Wait for windows services like winrm using a timer

**URL:** <https://forum.ansible.com/t/is-there-a-better-way-to-do-this-wait-for-windows-services-like-winrm-using-a-timer/34326>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [December 12, 2020, 8:47pm UTC](https://forum.ansible.com/t/is-there-a-better-way-to-do-this-wait-for-windows-services-like-winrm-using-a-timer/34326 "2020-12-12T20:47:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Maize](https://avatars.discourse-cdn.com/v4/letter/n/ee7513/32.png) [@Nick\_Maize](https://forum.ansible.com/u/Nick_Maize)\
**Post date:** [December 12, 2020, 8:47pm UTC](https://forum.ansible.com/t/is-there-a-better-way-to-do-this-wait-for-windows-services-like-winrm-using-a-timer/34326/1 "2020-12-12T20:47:49Z")

</div>

Right now I’m working on a project to join a Windows server to the domain, the process works but currently I’m waiting for the winrm service using win\_wait\_for. Is there a more dynamic way to do this? Generic example below of the wait.

- name: Wait for winrm to come back online after reboot

win\_wait\_for:  
port: “{{ ansible\_winrm\_port }}”  
delay: 60  
when: dc1.reboot\_required

Any help is greatly appreciated as I have wait timers in a lot of places and it feels like an area to make the code more efficient.
