Shutdown Script via PowerShell

2017-12-11T10:44:22+00:00 July 16th, 2012|PowerShell, Windows|0 Comments

We got requested recently to create a shutdown script for a specific number of servers. In PowerShell 2.0 there is a pretty easy way to go about this.

First of all what you need to do is create a TXT file with a list of the servers you want to shut down like so and name it servers.txt

image

Now to go about shutting down the server simply run the following command in PowerShell (Edit the below in bold to point to you TXT File)

Stop-Computer -cn (Get-Content C:ShutdownServer.txt) –force

Once you’ve ran this command the servers will all be shutdown Smile

Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
SUBSCRIBE!
Give it a try, you can unsubscribe anytime.