cancel
Showing results for 
Search instead for 
Did you mean: 
jijojoy
Cadet
Cadet
  • 1,027 Views

Windows Health check status

Hello Experts 

  bellow query to automate Windows server using ansible :

Needs to convert a task output as an aligned format such as Excel, HTML and etc, and send the same through a mail to the respective team 
 
Eg:  every day morning needs have system helth check (using PowerShell script ) and the status needs to send over the mail to the support team 
 
expecting your suggesting , what filters we can use to fulfill above requirements
Labels (2)
2 Replies
Tess
Flight Engineer
Flight Engineer
  • 1,010 Views

In my opinion, this is not something you would build using Ansible. You would only use Ansible to deploy the solution. 

  1. You can make a Powershell script that does what you want it to.
  2. You can use the Windows scheduling service (compare it to cron on Linux) to run it.
  3. You can use Ansible to deploy it. 
Chetan_Tiwary_
Community Manager
Community Manager
  • 993 Views

Hi @jijojoy ,

Thanks for reaching out !

You need three modules to work on this :

1. win_shell : https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_shell_module.html to run a command / powershell command to get the desired output. 

2. Format your output using "template" module or use this filter to convert the stdout to a table {{abc.stdout | table }}

3, use mail module to send a mail with that table attachment : https://docs.ansible.com/ansible/latest/collections/community/general/mail_module.html

Join the discussion
You must log in to join this conversation.