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.

<#
.SYNOPSIS
This script will provide the status of a service on the specified computer.
.DESCRIPTION
This script automates the process for verifying the status of a service.
.EXAMPLE
N/A.
.AUTHOR
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 {$_.name -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.