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

2 Comments

  1. Smooth as the silk ascot you should be wearing while sipping this barley wine ale brewed with fresh blackberries. A trip under your nose reveals aromas of toasted oak, caramel toffee and burgundy.

  2. Tonal adidas branding also appears on the heel and tongue to complete the look of the shoe. Said to be dropping at international retailers beginning next month, let us know if you plan on scooping up a pair once they arrive stateside.

Leave a Reply

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