Stop and Start SharePoint services with PowerShell

Here is an easy way to Stop and Start SharePoint services in PowerShell (especially if you have a large farm or manage multiple farms).
Im not talking about the Windows Services here but SharePoint services managed via Central Administration.

Note: Just update the $ServiceName variable as it appears in Central Administration and run.
The following PowerShell runs on the local server (-server $env:COMPUTERNAME). Replace $env:COMPUTERNAME with the server name in the farm to stop and start services on the other servers in the farm.

To stop a service:
$ServiceName = “Visio Graphics Service”
Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Stop-SPServiceInstance -confirm:$false > $null

To start a service:
$ServiceName = “Visio Graphics Service”
Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Start-SPServiceInstance -confirm:$false > $null

Leave a Reply

Your email address will not be published. Required fields are marked *