Reset virtual machine with powershell

This topic contains 2 replies, has 3 voices, and was last updated by  Raymond Slieff 3 years, 8 months ago.

  • Author
  • #19997

    Brian Petersen


    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

    Gordon Grant

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

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


    Mr G

  • #20162

    Raymond Slieff

    (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.