Geo*_*ge2 5 powershell windows-services
如果我知道服务名称并拥有足够的权限,如何在 PowerShell 中将 Windows 服务设置为自动重启?
我使用的是 PowerShell 1.0,操作系统是 Windows Server 2003。
您可能会要求:
Set-Service [service name] -startuptype automatic
Run Code Online (Sandbox Code Playgroud)
看:
> 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>]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5423 次 |
| 最近记录: |