Blog Post

PowerShell – CHECK, START and STOP SQL Services of a remote servers

,

Replace a valid server name in the following examples. Try to do a testing on your local machine and understand before you execute it on any Production Server.

Example 1: Find all SQL related services on HQSQ001

Get-Service -ComputerName HQSQ001 | ?{$_.Displayname -like “*SQL*“}|select name,Displayname,status

Example 2: Find all SQL related services on multiple servers[Separate the server name by comma]

Get-Service -ComputerName HQSQ001,HQSQ002 | ?{$_.Displayname -like “*SQL*“}|select name,Displayname,status

Example 3: Stop only SQL REPORTING Services on both the server

Get-Service -ComputerName HQSQ001,HQSQ002 | ?{$_.Displayname -match “SQL SERVER REPORT”}|%{$_.stop()}

Example 4: Start only SQL REPORTING Services on both the server

Get-Service -ComputerName HQSQ001,HQSQ002 | ?{$_.Displayname -match “SQL SERVER REPORT”}|%{$_.start()}

 

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating