PowerShell Logo Small

Stop-Service



This is the built-in help made by Microsoft for the command 'Stop-Service', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' 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 [-InputObject] <ServiceController[]> [-Exclude [<String[]>]] [-Force] [-Include [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire
| Ignore | Suspend}] [-InformationVariable [<System.String>]] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Service [-Exclude [<String[]>]] [-Force] [-Include [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}]
[-InformationVariable [<System.String>]] [-NoWait] [-PassThru] -DisplayName <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Service [-Name] <String[]> [-Exclude [<String[]>]] [-Force] [-Include [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore |
Suspend}] [-InformationVariable [<System.String>]] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]



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 by 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/p/?linkid=293923
Get-Service
New-Service
Restart-Service
Resume-Service
Set-Service
Start-Service
Suspend-Service

REMARKS

<

Examples


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

PS C:\>stop-service sysmonlog



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










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

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



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










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

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



The Stop-Service command stops the IISAdmin service on the local computer. Because stopping this service also stops the services that depend on the 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 Name 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 the Confirm parameter to
request confirmation from the user before stopping each service.