BoxiCredy
Contributor
Contributor

Scheduling VM removal from vSphere using PowerCLI

Hi, I am building PowerShell GUI tool for server decommission. Removal of VM entirely from vSphere is the last step in the code but due to company policy server can not be removed immediately - it must stay in the vSphere for 5 days or so. Is there any way of coding VM removal in 5 days time as vSphere scheduled task using PowerCLI?

Thank you in advance. 

0 Kudos
3 Replies
LucD
Leadership
Leadership

You can create a Scheduled Task for that


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
BoxiCredy
Contributor
Contributor

I am talking about vSphere scheduled task, not Windows. Is former even doable?

0 Kudos
LucD
Leadership
Leadership

I'm also talking about a vSphere Scheduled Task, more specifically with a MethodAction.
I did a blog post on the subject, see Scheduled Tasks – MethodAction
In this particular case, you would be using the Destroy method on the VM

.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos