Contact Info

Crumbtrail » Administration » Powershell » Powershell 2.0 » Restart-Service

Restart-Service - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Stops and then starts one or more services.

Restart-Service [-Name] <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-Wh
atIf] [<CommonParameters>]

Restart-Service -DisplayName <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm]
 [-WhatIf] [<CommonParameters>]

Restart-Service [-InputObject <ServiceController[]>] [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThr
u] [-Confirm] [-WhatIf] [<CommonParameters>]

The Restart-Service cmdlet sends a stop message and then a start message to the Windows Service Controller for a sp
ecified service. If a service was already stopped, it is started without notifying you of an error. You can specify
 the services by their service names or display names, or you can use the InputObject parameter to pass an object t
hat represents each service that you want to restart.