Skip to main content

PowerShell Stop-Service: Stop Windows Services Command

• 2 min read
powershell stop-service services system-administration tutorial

PowerShell Stop-Service: Complete Guide to Stopping Windows Services

Overview

The Stop-Service cmdlet stops running Windows services on local or remote computers. Essential for service management and troubleshooting.

Common Tasks:

  • Stop running services
  • Force stop problematic services
  • Stop services on remote computers
  • Stop multiple services at once
  • Automate service shutdown

Prerequisites:

  • PowerShell 5.1 or later
  • Administrator privileges required
  • Understanding of service dependencies

Syntax

Stop-Service [-Name] <string> [-Force] [-NoWait] [-PassThru] [-ComputerName <string[]>]
```powershell

### Key Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `-Name` | String | Service name to stop |
| `-Force` | Switch | Force stop (bypass graceful shutdown) |
| `-NoWait` | Switch | Don't wait for service to stop |
| `-PassThru` | Switch | Return service object |
| `-ComputerName` | String[] | Stop on remote computer |

---

## Examples

### Example 1: Stop Service by Name

```powershell
Stop-Service -Name "Spooler"
```powershell

### Example 2: Force Stop Service

```powershell
Stop-Service -Name "Spooler" -Force
```powershell

### Example 3: Stop Multiple Services

```powershell
"Spooler", "BITS" | Stop-Service
```powershell

### Example 4: Stop Service on Remote Computer

```powershell
Stop-Service -Name "Spooler" -ComputerName "server01"
```powershell

### Example 5: Safely Stop Service

```powershell
$service = Get-Service -Name "ServiceName"
if ($service.Status -eq "Running") {
    Stop-Service -Name $service.Name -Force
}
```powershell

---

## Error Handling

### Handle Service Busy
```powershell
try {
    Stop-Service -Name "Spooler" -Force -ErrorAction Stop
}
catch {
    Write-Host "Error stopping service: $_"
}
```powershell

---

## Best Practices

✅ **Graceful shutdown first** - Try without -Force first
✅ **Check dependencies** - Understand dependent services
✅ **Stop safe services only** - Avoid critical system services
✅ **Verify startup type** - Don't stop Automatic services

### Related Commands
- **[Start-Service](/powershell-start-service)** - Start services
- **[Restart-Service](/powershell-restart-service)** - Restart services
- **[Get-Service](/powershell-get-service)** - Query services

---

## See Also

- **[Get-Service](/powershell-get-service)** - Query services
- **[Start-Service](/powershell-start-service)** - Start services
- **Complete PowerShell Guide** - PowerShell overview

---

**Last Updated:** February 6, 2026
**Difficulty Level:** Intermediate
**Reading Time:** 8 minutes