VMware Cloud Community
subburamanraju
Contributor
Contributor

How to Reboot multiple VMs through Power CLI command

How to Reboot multiple VMs through Power CLI command

Reply
0 Kudos
4 Replies
Ajay1988
Expert
Expert

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
Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

@subburamanraju 

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


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
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

Reply
0 Kudos
Sam0054
Enthusiast
Enthusiast

@subburamanraju 

You can reboot multiple VMs via:


Restart-VM VM1,VM2,VM3,VM4 -- replace VM1,V2 etc with your VM name

Click y for single VM reboot and A for all

 

Please give a thumbs up if this was helpful

Reply
0 Kudos