PowerShell Logo Small

Suspend-Service



This is the built-in help made by Microsoft for the command 'Suspend-Service', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Suspends (pauses) one or more running services.

SYNTAX


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



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
service is still running, but its action is halted until resumed, such as by using Resume-Service. 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
suspend.



<

RELATED LINKS

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

REMARKS

<

Examples


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

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



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








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

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



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








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

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



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








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

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



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 services on the computer. The pipeline operator (|) passes the results to the Where-Object cmdlet, which selects only the services that
have a value of "True" for the CanPauseAndContinue property. Another pipeline operator passes the results to the Suspend-Service cmdlet. The
Confirm parameter prompts you for confirmation before suspending each of the services.