Reset virtual machine with powershell

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of Raymond Slieff Raymond Slieff 2 years, 1 month ago.

  • Author
    Posts
  • #19997
    Profile photo of Brian Petersen
    Brian Petersen
    Participant

    Hi,

    I been trying to find a powershell script which can reset a virtual machine on a Horizon view server.
    I can find scripts and examples, which disconnects and logoff users, but i cant find a reset command.

    Can anyone help me?

  • #20043
    Profile photo of Gordon Grant
    Gordon Grant
    Participant

    Wouldn't something simple like the below do the job?

    Get-VM -Name "Some VM" | Restart-VM

    Regards

    Mr G

  • #20162
    Profile photo of Raymond Slieff
    Raymond Slieff
    Participant

    (blockquote)Horizon view server(/blockquote)

    I believe that means you are using VMware to host the Virtual Machines and so you are using PowerCLI to get that done?

    If so, the command for a machine with VMTools installed is Shutdown-VMGuest, if you do not have VMTools installed you have to use Stop-VM which will just power it off.
    Another gotcha here is that these two cmdlets take different input objects.

    Let me know if that helps at all or if I ventured down the wrong path.

You must be logged in to reply to this topic.