Suspends (pauses) one or more running services. (Suspend-Service)

   

# NAME
Suspend-Service

# 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] [<CommonParameters>]

# 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.

# PARAMETERS
-DisplayName <string[]>
Specifies the display names of the services to be suspended. Wildcards are permitted.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Exclude <string[]>
Omits the specified services. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as "s*". Wildcards are permitted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Include <string[]>
Suspends only the specified services. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as "s*". Wildcards are permitted.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-InputObject <ServiceController[]>
Specifies ServiceController objects representing the services to be suspended. Enter a variable that contains the objects, or type a command or expression that gets the objects.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Name <string[]>
Specifies the service names of the services to be suspended. Wildcards are permitted.

The parameter name is optional. You can use "Name" or its alias, "ServiceName", or you can omit the parameter name.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-PassThru [<SwitchParameter>]
Returns an object representing the service. By default, this cmdlet does not generate any output.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm [<SwitchParameter>]
Prompts you for confirmation before executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf [<SwitchParameter>]
Describes what would happen if you executed the command without actually executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
System.ServiceProcess.ServiceController or System.String
You can pipe a service object or a string that contains a service name to Suspend-Service.

# OUTPUTS
None or System.ServiceProcess.ServiceController
When you use the PassThru parameter, Suspend-Service generates a System.ServiceProcess.ServiceController object representing the service. Otherwise, this cmdlet does not generate any output.

# NOTES

Suspend-Service can control services only when the current user has permission to do so. If a command does not work correctly, you might not have the required permissions.

Also, Suspend-Service can suspend only services that support being suspended and resumed. To determine whether a particular service can be suspended, use the Get-Service cmdlet with the CanPauseAndContinue property. For example, "get-service wmi | format-list name, canpauseandcontinue". To find all services on the computer that can be suspended, type "get-service | where-object {$_.canpauseandcontinue -eq "True"}".

To find the service names and display names of the services on your system, type "get-service". The service names appear in the Name column, and the display names appear in the DisplayName column.

# 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, rerun 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 operator (|) 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 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.

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

C:\Windows>powershell get-help Resume-Service -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows-10 / Windows-8.1 & 8 / Windows-7 & Vista / Windows Server 2008-2016
»»»» ColorConsole



 


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell





;-)









Download the Windows 10 Starter, Home (Basic Premium), Professional und Ultimate!

... facebook.de
0.109
Wie kann ich die Desktop Fenster sinnvoll anordnen?  / Ein Problem mit Zip-Ordnern bei kopieren, ausschneiden und einfügen!  / Was bedeutet WOW64 beim Windows-7 Betriebssystem?  / Wartezeiten beim Herunterfahren von Windows verkürzen!  / Wie kann ich die Bookmarks von FLOCK importieren ?  / Auto Shutdown in Windows 8, 10 und 8.1 (herunterfahren)!  / Kann man in Windows-8 Desktop -Symbole automatisch anordnen- deaktivieren (Windows 8.1, 7, 10)?  / Gelöschte Windows-8.1 / 10 Dateien und Ordner wiederherstellen?  / Wie kann ich Windows-10 ohne Microsoft Account Konto installieren?  / Windows 7 Auto-Updates deaktivieren, bzw. ausschalten?  / Die Sprache für das Tastatur Layout in Windows 8.1 ändern und hinzufügen?  / Einfache Freigabe unter Windows-7 ohne Kennwort (Passwort)?  /