In this section, we will discuss ways in which we can create a vSphere scheduled task using the vSphere API through PowerCLI. For this, we will use the
ServiceInstance managed object. This is the singleton root object in the inventory.
For more details, please check the vSphere API documentation at Managed Object Types | ServiceInstance (http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.wssdk.apiref.doc/vim.ServiceInstance.html).
To create a scheduled task, we will use the
CreateScheduledTask method. If we examine the method, we can see that this method takes two inputs: an entity (
MoRef) and a specification (
To create a task, we need to create a scheduled task specification. This in ...