Restart-Service [-Force] [-PassThru] -DisplayName <String[]> [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]说明此cmdlet 仅在 Windows 平台上可用。Restart-Service cmdlet 向 Windows 服务控制器针对指定服务发送一条停止消息和一条启动消息。 如果...
PowerShell中重启服务的cmdlet是Restart-Service,顾名思义就是把服务停⽌了再启动起来。语法结构 关于Restart-Service的详细语法结构如下:复制代码代码如下:Restart-Service [-Name] <string[]> [-Exclude <string[]>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf][<CommonParameters...
Restart-Service-Name"ServiceName" 这个命令将重启名为 "ServiceName" 的服务。 Remove-Service:删除一个服务。 powershellCopy Code Remove-Service -Name "ServiceName" 这个命令将从系统中删除名为 "ServiceName" 的服务。 Get-ServiceLogonAccount:获取服务的登录帐户。 powershellCopy Code Get-ServiceLogonAccou...
Restart-Service[-Force] [-InputObject] <ServiceController[]> [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] PowerShell Restart-Service[-Force] [-Name] <String[]> [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-What...
Restart-Service [-Force] [-InputObject] <ServiceController[]> [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]PowerShell نسخ Restart-Service [-Force] [-Name] <String[]> [-PassThru] [-Include <String[]>] [-Exclude <String...
How to Restart a Service in PowerShell? To restart a service in PowerShell, use the Restart-Service cmdlet. This cmdlet allows you to stop and then start a specified service on a local or remote computer. Here’s an example: Restart-Service -Name "ServiceName" ...
虽然这些 Service cmdlet 没有 ComputerName 参数,但是你可通过使用Invoke-Commandcmdlet 在远程计算机上运行它们。 例如,下面的命令在 Server01 远程计算机上重启后台打印程序服务。 PowerShell Invoke-Command-ComputerNameServer01 {Restart-ServiceSpooler} 设置服务属性 ...
#重启服务PS C:\Users\Administrator> Restart-Service WinRM PS C:\Users\Administrator> Get-Service WinRM Status Name DisplayName--- --- ---Running WinRM Windows Remote Management (WS-Manag...
Get-CimInstance-ClassNameWin32_Service|Select-Object-PropertyStatus,Name,DisplayName 输出 Status Name DisplayName --- --- --- OK AJRouter AllJoyn Router Service OK ALG Application Layer Gateway Service OK AppIDSvc Application Identity OK Appinfo Application...
Restart-Service winrm 可选:如果使用IBM Spectrum Protect Snapshot for Microsoft Exchange Server软件,请启用含凭证安全性支持提供程序 (CredSSP) 认证的 Windows PowerShell Remoting 功能。 请完成以下步骤: 在主系统上,输入以下命令以启用含 CredSSP 的 Windows PowerShell Remoting 功能: ...