Kill pending windows service

2021-01-19 09:15

阅读:600

标签:pre   proc   instance   ORC   rms   run   ssid   get   end   

Get-Service winrm -Verbose
$winrmService=Get-CimInstance -ClassName win32_Service |? {$_.Name -eq "winrm"}
$id=$winrmService.ProcessId
$status=$winrmService.State
if(($id -ne 0) -and ($status -ne "Running"))
{
   "it will kill winrm process"
    kill -Id $id -Force -Verbose
    winrm qc -q
}
Get-Service winrm -Verbose

Kill pending windows service

标签:pre   proc   instance   ORC   rms   run   ssid   get   end   

原文地址:https://www.cnblogs.com/talentzemin/p/12158652.html


评论


亲,登录后才可以留言!