Home > PowerShell > PowerShell – Check if “SMS Agent Host” is Running and Start if Not

PowerShell – Check if “SMS Agent Host” is Running and Start if Not


# PowerShell script
# Josh Mueller – 2010
# Script to check whether the "SMS Agent Host" is running
# The script will start the service if it is not running
cls
$sName = "SMS Agent Host"
$service = get-service -display $sName -ErrorAction SilentlyContinue
$startService = Start-Service $sname
if ($service.Status -eq "Running")
 { $sName + " is Running" }
else {$startService}
Advertisements
Categories: PowerShell
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: