PowerShell for Windows Admins

Jan 16 2014   1:58PM GMT

Win32_Process examples–terminate process

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Terminating a running process is simply a case of calling the Terminate method:

function remove-proc{


param (

[string]$computername = $env:COMPUTERNAME,



Get-CimInstance -ClassName Win32_Process -ComputerName $computername -Filter “Name = ‘$processname'” |

Invoke-CimMethod -MethodName Terminate


This will terminate all instances of a given process.  If you want to be more selective then change the function to use the process id rather than the process name

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: