recent
أخبار ساخنة

How to Stop Service Using PowerShell

Home
PowerShell

This section is about cmdlets that are installed with the PowerShell module in Microsoft PowerShell Management.

Contains cmdlets that help you manage Windows in PowerShell.

Stop-Service



The Stop-Service command sends a message that a Windows service has stopped.

Services can be identified by their service names or display name.


Examples of Stop-Service

example 1

Stop a service on the local computer



Stop-Service -Name "Print Spooler"



Example 2

Stop a service using a display name



Get-Service -DisplayName "telnet" | Stop-Service



Example 3

Stop a service that has dependent (authorized) services on it



Get-Service -Name "iisadmin" | Format-List -Property Name, DependentServices

Stop-Service -Name "iisadmin" -Force -Confirm



This example stops the IISAdmin service on the computer.

Since stopping this service also stops services that depend on the IISAdmin service, it is better to precede Stop-Service, which invokes services that depend on the IISAdmin service, use Get-Service.
google-playkhamsatmostaqltradent