I want to Power Off a VM, I am able to connect to vm using ConnectToVMWareVIServer method of VIX but I am getting error on when I try to Open the connection. I am getting an exception Failed to open Virtaul machine.. with inner exception "One of the paramters was invalid"
I am new to VMWare hence I used the c# code mentioned in https://github.com/dblock/vmwaretasks
using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())
{
// connect to a remove (VMWare ESX) virtual machine
virtualHost.ConnectToVMWareVIServer(vmIPAddress, vmUserID, vmPassword);
// open an existing virtual machine
using (VMWareVirtualMachine virtualMachine = virtualHost.Open(vmVMXPath))
{
// power on this virtual machine
virtualMachine.PowerOff();
// wait for VMWare Tools
}
}