# windows host automation

**URL:** <https://forum.ansible.com/t/windows-host-automation/35639>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [August 19, 2021, 9:34am UTC](https://forum.ansible.com/t/windows-host-automation/35639 "2021-08-19T09:34:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sakshi\_Jain](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Sakshi\_Jain](https://forum.ansible.com/u/Sakshi_Jain)\
**Post date:** [August 19, 2021, 9:34am UTC](https://forum.ansible.com/t/windows-host-automation/35639/1 "2021-08-19T09:34:55Z")

</div>

For windows host

How to write tasks in ansible :

1. Login into RDP machine
2. Login into other machines from RDP machine
3. Read email before starting the patching in the scheduled time
4. Run any commands in rdp machine , like below :
5. To shutdown : shutdown /r /f /m \
6. Reboot status : systeminfo /s | find “ System Boot Time “
7. Verify the timezone
8. Uptime of the server , store it in a file
9. Check ToNCR task from task scheduler , task is scheduled as cron job in every 5minutes
10. Send email to predefined recipients for task update
11. Read logs , scheduler logs , hmlogs , publish logs

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [September 22, 2021, 10:36am UTC](https://forum.ansible.com/t/windows-host-automation/35639/2 "2021-09-22T10:36:13Z")

</div>

I am not sure Ansible can read mail, however you can use the win\_updates module to patch your windows machine
