0
如果我知道一个服务名称并拥有足够的权限,如何将Windows服务设置为在PowerShell中自动重新启动?如何将Windows服务设置为在PowerShell中自动重新启动?
我使用的PowerShell 1.0,操作系统是Windows Server 2003
如果我知道一个服务名称并拥有足够的权限,如何将Windows服务设置为在PowerShell中自动重新启动?如何将Windows服务设置为在PowerShell中自动重新启动?
我使用的PowerShell 1.0,操作系统是Windows Server 2003
你可能会问了:
Set-Service [service name] -startuptype automatic
参见:
> 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>]
它是设置服务stratup模式。但我想,乔治想要在服务崩溃时配置自动重启服务。 – 2009-08-02 13:53:22