PowerCLI

 View Only

 Can PowerCLI be used to set Standby Response for Virtual Machines?

Alex Sons's profile image
Alex Sons posted Dec 10, 2025 09:07 AM

The power management option for Virtual Machines provides a choice between "Suspend the virtual machine" and "Put the guest OS.....powered on".

Of course the GUI can be used (select Virtual Machine, Edit Settings, VM Options, Power management) to check and/or change the value.

PowerCLI can be used to check current setting for Standby response (to be found in ExtensionData.config.DefaultPowerOps):


Get-VM -server $vc -YourVMname |select Name, @{N='StandbyAction';E={($_.ExtensionData.config.DefaultPowerOps |select StandbyAction).StandbyAction }}

Another way is to use VIproperty, which I prefer, like:
New-VIProperty –ObjectType VirtualMachine –Name StandbyAction  -Value { ($args[0].ExtensionData.config.DefaultPowerOps |select StandbyAction).StandbyAction }
Get-VM -server $vc -YourVMname |select Name, StandbyAction

The Standby respons is either set to "powerOnSuspend" or "checkpoint".

We have multiple (>400) virtual machines for which the Standby response is set to "Suspend the virtual machine".

Is there any way we can script to change the Standby response setting from "powerOnSuspend" or "checkpoint"?

MohammadHadi Milani's profile image
MohammadHadi Milani

$vm = Get-VM -name "test01"
New-AdvancedSetting -Entity $vm -Name "powerOpInfo.standbyAction" -Value "powerOnSuspend" -Force 
Not sure this works or not. If it doesnt work the last option is to do it via rest API .

ITSavant's profile image
ITSavant

While I haven't tested this, maybe this will put you on the right track for automation:

$VM = Get-VM -Name "MyVM"
$Spec = [VMware.Vim.VirtualMachineConfigSpec]::new()
$Spec.PowerOpInfo = [VMware.Vim.VirtualMachineDefaultPowerOpInfo]::new()
$Spec.PowerOpInfo.StandbyAction = "powerOnSuspend"

$VM.ExtensionData.ReconfigVM($Spec)
$VM.UpdateViewData()
$VM.ExtensionData.Config.DefaultPowerOps.StandbyAction

I think the VMs have to be powered off first, haven't tested, that part is yours....

EDIT: I just tested it does work, but the VM I used was powered off, and a live VM said, power off first.