PowerShell: Check Service Status


To ensure the Backup Exec Agent service running OK on each cluster nodes. I created a list to include each nodes and named it as CS_servers.txt, then use the following script to get the status of it.

Get-WmiObject win32_service -ComputerName (Get-Content CS_servers.txt) -Filter “name=’BackupExecAgentAccelerator'” | select __server,name,startmode,state,status

The results are like:

__SERVER  : CS-node-01
name      : BackupExecAgentAccelerator
startmode : Auto
state     : Running
status    : OK

__SERVER  : CS-node-02
name      : BackupExecAgentAccelerator
startmode : Auto
state     : Running
status    : OK

__SERVER  : CS-node-03
name      : BackupExecAgentAccelerator
startmode : Auto
state     : Running
status    : OK

Advertisements

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