Hello everyone,
If I know a service name, and have enough permission. My question is how to set a Windows Service to be auto-restart in PowerShell? I am using PowerShell 1.0, OS is Windows Server 2003.
thanks in advance, George
Hello everyone,
If I know a service name, and have enough permission. My question is how to set a Windows Service to be auto-restart in PowerShell? I am using PowerShell 1.0, OS is Windows Server 2003.
thanks in advance, George
Are you perchance asking for
Set-Service [service name] -startuptype automatic
EDIT
>get-help set-service
NAME
Set-Service
SYNOPSIS
Starts, stops, and suspends a service, and changes its properties.
SYNTAX
Set-Service [-StartupType {Automatic | Manual | Disabled}] [-DisplayName <string>] [-PassThru] [-Status <string>] [
-InputObject <ServiceController>] [-Description <string>] [-ComputerName <string[]>] [-confirm] [-whatif] [<CommonP
arameters>]
Set-Service [-Status <string>] [-StartupType {Automatic | Manual | Disabled}] [-Description <string>] [-Name] <stri
ng> [-PassThru] [-DisplayName <string>] [-ComputerName <string[]>] [-confirm] [-whatif] [<CommonParameters>]