Automate your mundane
IT Tasks using our pre-made,
ready-to-run scripts.
Slider

Want to start/stop/restart a particular Windows Service?

This script will start Windows Services. If necessary, the script can be modified to stop, or even Restart a service

Syntax

Restart-Service
[-Force]
[-InputObject] <ServiceController[]>
[-PassThru]
[-Include <String[]>]
[-Exclude <String[]>]

Download Full Script

Example 1: Restart a service on the local computer

PS C:\> Restart-Service -Name ‘ServiceName’


Example 2: Start all stopped network services

PS C:\> Get-Service -Name “net*” | Where-Object {$_.Status -eq “Stopped”} | Restart-Service

Share Script:

Purpose:This script will help you to start/restart/stop any Windows Service
Modification:Service restart script can be modified as per your requirements
Type:PowerShell Script (ps1) 
Compatibility:Windows 
Tags:PowerShell, Restart Windows Services.
Reference link:

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.1