PowerShell won't terminate hung process

前端 未结 1 781
忘掉有多难
忘掉有多难 2020-12-19 12:43

I have a scenario where a process is stuck every single Monday morning because of an Oracle database so I tried creating a PowerShell script to run every Monday but regardle

相关标签:
1条回答
  • 2020-12-19 12:44

    Try using:

    $termproc = (get-wmiobject -ComputerName $server -Class Win32_Process -Filter "name like 'ez0%'"
    $termproc.terminate()
    

    You could also just do the below if you don't want to check the processes in the variable first.

    (get-wmiobject -ComputerName $server -Class Win32_Process -Filter "name like 'ez0%'").terminate()
    

    Thanks, Tim.

    0 讨论(0)
提交回复
热议问题