Stop a Service Instance
Scenario/Problem: You need to stop a specific service instance.
Solution: Use the Get-SPServiceInstance
cmdlet to assign a variable to the results using the -Identity
parameter, and then use Stop-SPServiceInstance
using that variable.
The Stop-SPServiceInstance
cmdlet stops the specified service on the current server. You can provide the identity directly to the cmdlet or use a variable, as shown in Listing 6.10.
$serviceInst = Get-SPServiceInstance -Identity 5fedc699-7810-4157-9c59-19f7d6e67e38Stop-SPServiceInstance $serviceInst
Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.