Shutdown Script via PowerShell

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

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


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