Most if not all of my clients have this script setup to run daily so that reports could be sent to them to either identify potential issues before the start of the day or lingering issues that they may not have been aware about. I highly recommend implementing this in all vSphere environments at some capacity to gain insight into the hosts and vCenter.

One of the most common issues clients tend to face is how to set this script to run automatically in a Windows Task Scheduler so this post serves to demonstrate the way I usually set it up.

Begin by launching Task Scheduler on a server you would like to select to execute this task:

Select the folder you would like to create the task in, then right click in the window and select Create New Task...:

Enter a name for the task, select Run whether user is logged on or not and enable Run with highest privileges in the General tab: