PowerShell Logo Small

Stop-Service



This is the built-in help made by Microsoft for the command 'Stop-Service', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Stops one or more running services.

SYNTAX


Stop-Service [-Name] <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Service -DisplayName <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Service [-InputObject <ServiceController[]>] [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonP
arameters>]



Search powershellhelp.space

DESCRIPTION


The Stop-Service cmdlet sends a stop message to the Windows Service Controller for each of the specified services. You can specify the services b
y their service names or display names, or you can use the InputObject parameter to pass a service object representing the services that you want
to stop.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113414
Get-Service
Suspend-Service
Start-Service
Restart-Service
Resume-Service
Set-Service
New-Service

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>stop-service sysmonlog



Description
-----------
This command stops the Performance Logs and Alerts (SysmonLog) service on the local computer.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>get-service -displayname telnet | stop-service



Description
-----------
This command stops the Telnet service on the local computer. The command uses the Get-Service cmdlet to get an object representing the Telnet ser
vice. The pipeline operator (|) pipes the object to the Stop-Service cmdlet, which stops the service.








-------------------------- EXAMPLE 3 --------------------------

C:\PS>get-service iisadmin | format-list -property name, dependentservices

C:PS>stop-service iisadmin -force -confirm



Description
-----------
The Stop-Service command stops the IISAdmin service on the local computer. Because stopping this service also stops the services that depend on t
he IISAdmin service, it is best to precede the Stop-Service command with a command that lists the services that depend on the IISAdmin service.

The first command lists the services that depend on IISAdmin. It uses the Get-Service cmdlet to get an object representing the IISAdmin service.
The pipeline operator (|) passes the result to the Format-List cmdlet. The command uses the Property parameter of Format-List to list only the Na
me and DependentServices properties of the service.

The second command stops the IISAdmin service. The Force parameter is required to stop a service that has dependent services. The command uses th
e Confirm parameter to request confirmation from the user before stopping each service.