I have a VM running Windows 10. I would like to have a workflow that gathers and outputs the running processes and PIDs. This output could simply be System.log("Process Name"). This will need to be an array and be able to reference the process name (assign to a variable). Any help would be appreciated. Thanks Tom
Hi,
The following sample code shows how to enumerate running processes and print their PID and name:
var procman = vm.sdkConnection.guestOperationsManager.processManager;
var procs = procman.listProcessesInGuest(vm, new VcNamePasswordAuthentication(false, vmUsername, vmPassword));
for each (var p in procs) {
System.log("Process pid: " + p.pid + " name: " + p.name);
}
Input parameters are vm (of type VC:VirtualMachine), vmUsername and vmPassword.
Hi,
The following sample code shows how to enumerate running processes and print their PID and name:
var procman = vm.sdkConnection.guestOperationsManager.processManager;
var procs = procman.listProcessesInGuest(vm, new VcNamePasswordAuthentication(false, vmUsername, vmPassword));
for each (var p in procs) {
System.log("Process pid: " + p.pid + " name: " + p.name);
}
Input parameters are vm (of type VC:VirtualMachine), vmUsername and vmPassword.