subburamanraju
Contributor
Contributor

How to Reboot multiple VMs through Power CLI command

How to Reboot multiple VMs through Power CLI command

0 Kudos
3 Replies
Ajay1988
VMware Employee
VMware Employee

Please check   https://www.running-system.com/powercli-script-to-power-off-and-power-on-dedicated-vms-listed-in-fil... 

If you think your queries have been answered
Mark this response as "Correct" or "Helpful".

Regards,
AJ
0 Kudos
scott28tt
VMware Employee
VMware Employee

@subburamanraju 

Moderator: Moved to PowerCLI Discussions, a search in this area will likely return an answer.

0 Kudos
LucD
Leadership
Leadership

Do all these VMs have the VMware Tools installed in the Guest OS?

If yes, you can use something like this (you can use the use the Get-VM cmdlet to select a subset of VMs if needed)

Get-VM | Restart-VMGuest -Confirm:$false

If the VMs, or some of them, do not have the VMware Tools installed, you will have to use a remote method linked to the Guest OS.
But this requires certain settings in the Guest OS.
For example, to use a remote PowerShell command, you need to have PS remoting to be configured and allowed.


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

0 Kudos