This post is all about how to start stop manage services in windows server with powershell. We will discuss the start service powershell command, stop service powershell command, Killing Windows Service that Hangs on Stopping or Not Responding command, how to get service powershell command, how to set service startup type powershell command.
Get Service powershell command windows server
This command will display all service on computer. Default display will be status, service name, and display name each service
Get-Service
Get service begin with search string
Get service begin with Display services that include search string “sp”
Get-Service "sp*" | Sort-Object status

Display services that include search string
Display services that include search string “sharepoint”
Get-Service -Displayname "*sharepoint*"

Get services begin with search string and an exclusion
Get services begin with search string “sp” and an exclusion “spo”
Get-Service -Name "sp*" -Exclude "spooler","sppsvc"

Get object details for service
Get-Service SPAdminV4 | Select-Object *
Display services that are running
Display services with status Running
Get-Service | Where-Object {$_.Status -eq "Running"}

Display services that are Stopped
Display services with status “Stopped”
Get-Service | Where-Object {$_.Status -eq "Stopped"}

Start Service powershell command
Below command returns how to start a particular service using powershell.
Start-Service ServiceName
example: ServiceName = SPAdminV4
Start-Service SPAdminV4
Stop Service powershell command
Below command returns how to stop a particular service using powershell.
Stop-Service ServiceName
example: ServiceName = OSearch16
Stop-Service OSearch16
Disable Service powershell command
Below command returns how to disable a particular service using powershell.
Set-Service ServiceName -StartupType Disabled
or
Set-Service -Name ServiceName -StartupType Disabled
example: ServiceName = OSearch16
Set-Service -Name OSearch16 -StartupType Disabled
Start Service with status stopped
Start service whose status is stopped bu running below command.
Get-Service Wsearch | Where {$_.status –eq 'Stopped'} | Start-Service
stop start disable particular windows services with status stopped running stopping using powershell
Categories: sharepoint services, windows service
You must be logged in to post a comment.