Skip to content

Microsoft Windows Server 2012 R2 – Verify Service Status

You may use the Microsoft Windows PowerShell script below to verify the status of the service you specify, remotely.

This script will provide the status of a service on the specified computer.
This script automates the process for verifying the status of a service.
Written by Noel Enrique Alvarez on Tuesday, November 24, 2015.

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

#Request the name of the service
$SERVICE = Read-Host “What is the name of the service?”

#Query the status of the service
get-service -computername $SERVER | where-object {$ -eq “$SERVICE”}

#End of script

Published inAutomationMicrosoft Windows PowerShellMicrosoft Windows Server 2008Microsoft Windows Server 2008 R2Microsoft Windows Server 2012Microsoft Windows Server 2012 R2Scripting

Comments are closed.