Skip to content

Microsoft Windows Server 2012 R2 – Remote Server Reboot

You may use the Microsoft Windows PowerShell script below to remotely reboot a Microsoft Windows Server 2012 R2 host.

<#
.SYNOPSIS
This script will request the hostname of a remote server then forcefully restart the server.
.DESCRIPTION
This script will automate the process of forcefully restarting a remote server.
.EXAMPLE
N/A.
.AUTHOR
Written by Noel Enrique Alvarez on Monday, August 08, 2016.
#>

#Request the hostname of the remote server
$SERVER = Read-Host “What is the hostname of the server?”

#Force the restart of the remote server
Restart-Computer $SERVER -Force

#End of script

Published inAutomationMicrosoft Windows PowerShellMicrosoft Windows Server 2012Scripting

Comments are closed.