Rotating Header Image

Rebooting a Server Using PowerShell

The more I work with PowerShell the more I love it :)

love4

So what do you do if you’re in a VM environment and you want/need to reboot your server but you can’t connect via RDP and you can’t connect to the console using the VM Infrastructure Client, and all other attempts to connect just don’t work.  I decided to go down the route of using PowerShell.

$ServerToRestart = Get-WMIObject win32_operatingsystem -computer <<Your Server Name Here>>
$ServerToRestart.reboot()

Get-WMIObject – Windows PowerShell: The WMI Connection

Simple, easy and very dangerous/powerful.  I’ll channel my inner “Uncle Ben” (see Spiderman quotes) and just leave this message as a closing thought:

“With Great Power Comes Great Responsibility”

Enjoy!!

Post to Twitter Post to Delicious Post to Digg Post to StumbleUpon

Leave a Reply

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.