PowerShell Logo Small

Suspend-Service



This is the built-in help made by Microsoft for the command 'Suspend-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

Suspends (pauses) one or more running services.

SYNTAX


Suspend-Service [-Name] <string[]> [-Exclude <string[]>] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Suspend-Service -DisplayName <string[]> [-Exclude <string[]>] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Suspend-Service [-InputObject <ServiceController[]>] [-Exclude <string[]>] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParamet
ers>]



Search powershellhelp.space

DESCRIPTION


The Suspend-Service cmdlet sends a suspend message to the Windows Service Controller for each of the specified services. While suspended, the ser
vice is still running, but its action is halted until resumed, such as by using Resume-Service. You can specify the services by their service nam
es or display names, or you can use the InputObject parameter to pass a service object representing the services that you want to suspend.



<

RELATED LINKS

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

REMARKS

<

Examples


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

C:\PS>suspend-service -displayname "Telnet"



Description
-----------
This command suspends the Telnet service (Tlntsvr) service on the local computer.








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

C:\PS>suspend-service -name lanman* -whatif



Description
-----------
This command tells what would happen if you suspended the services that have a service name that begins with "lanman". To suspend the services, r
erun the command without the WhatIf parameter.








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

C:\PS>get-service schedule | suspend-service



Description
-----------
This command uses the Get-Service cmdlet to get an object that represents the Task Scheduler (Schedule) service on the computer. The pipeline ope
rator (|) passes the result to the Suspend-Service cmdlet, which suspends the service.








-------------------------- EXAMPLE 4 --------------------------

C:\PS>get-service | where-object {$_.canpauseandcontinue -eq "True"} | suspend-service -confirm



Description
-----------
This command suspends all of the services on the computer that can be suspended. It uses the Get-Service cmdlet to get objects representing the s
ervices on the computer. The pipeline operator (|) passes the results to the Where-Object cmdlet, which selects only the services that have a val
ue of "True" for the CanPauseAndContinue property. Another pipeline operator passes the results to the Suspend-Service cmdlet. The Confirm parame
ter prompts you for confirmation before suspending each of the services.