Stop one or more running services.

      Stop-Service { [-name] string[]
                   | [-displayName] string[]
                   | [-inputObject ServiceController[]] }
                        [-include string[]] [-exclude string[]]
                           [-force] [-passthru] [-whatIf]
                              [-confirm] [CommonParameters]

   -name string
       The service names to be stopped.

   -displayName string
       The display names to be stopped, wildcards are permitted.

   -inputObject ServiceController
       Stop the services represented by ServiceController.
       Enter a command, expression or variable contains the objects.

   -include string
       Stop only the specified services. qualifies the Name parameter.
       Wildcards , such as "s*" are permitted.

   -exclude string
       Omit the specified services e.g. "*SS64*"
       Qualifies the -Name parameter, Wildcards are permitted.

       Override restrictions that prevent the command from succeeding, apart
       from security settings. e.g. -Force will stop a service
       that has dependent services.

        Pass the object created by Stop-Service along the pipeline. 

       Describe what would happen if you executed the command without
       actually executing the command.

       Prompt for confirmation before executing the command.

Standard Aliases for Stop-Service: spsv

-ServiceName is an alias for -Name.


Stop the Performance Logs and Alerts (SysmonLog) service on the local computer.:

PS C:\> stop-service sysmonlog

Use -force to stop a service that has dependent services, the first command below lists the dependant services of iis:

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

“It [the Cheshire Cat] vanished quite slowly, beginning with the end of the tail, and ending with the grin, which remained some time after the rest of it had gone” ~ Lewis Carroll

Related PowerShell Cmdlets

Get-Service - Get a list of services.
New-Service - Create a new service.
- Restart a stopped service.
- Resume a suspended service.
- Make and set changes to the properties of a service.
- Start a stopped service.
- Suspend a running service.
Windows cmd command: NET START / SC - Service Control.

Copyright © 1999-2024
Some rights reserved