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

Leave a comment