Skip to main content

Set-ServiceStartMode

SYNOPSISโ€‹

Set the service startup mode.

SYNTAXโ€‹

Set-ServiceStartMode [-Name] <String> [[-ComputerName] <String>] [-StartMode] <String>
[[-ContinueOnError] <Boolean>] [<CommonParameters>]

DESCRIPTIONโ€‹

Set the service startup mode.

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Set-ServiceStartMode -Name 'wuauserv' -StartMode 'Automatic (Delayed Start)'

PARAMETERSโ€‹

-Nameโ€‹

Specify the name of the service.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ComputerNameโ€‹

Specify the name of the computer. Default is: the local computer.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: $env:ComputerName
Accept pipeline input: False
Accept wildcard characters: False

-StartModeโ€‹

Specify startup mode for the service. Options: Automatic, Automatic (Delayed Start), Manual, Disabled, Boot, System.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ContinueOnErrorโ€‹

Continue if an error is encountered. Default is: $true.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

Noneโ€‹

This function does not return any objects.โ€‹

NOTESโ€‹

https://psappdeploytoolkit.com