VMware Cloud Community
brandong08
Enthusiast
Enthusiast

Take Screenshot of Running VM

I am looking for a way to create a screenshot of a running VM.  I know of the createScreenshot_Task but I am not sure how to use it.  Is there any information on how to create a workflow to do this?

Thanks

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Create a workflow, add an input parameter to it, give it some name (for example vm) and set its type to VC:VirtualMachine. Then add a scriptable task item, bind the vm input parameter as in parameter, and add the following scripting code:

// start the task

var task = vm.createScreenshot_Task();

// wait for task to complete

var result = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task, true, 1);

0 Kudos
brandong08
Enthusiast
Enthusiast

Thanks.  I will try that. 

0 Kudos