This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.
Stop-RemoteProcess
Synopsis
Stops a program or executable on a remote computer.Syntax
- Stop-RemoteProcess [-ID] [-ComputerName] [-Credential]
- Stop-RemoteProcess [-Name] [-ComputerName] [-Credential]
Description
Stop-RemoteProcess is used to halt executables on remote computers. It is similar to the built-in Stop-Process cmdlet, but can also be used against remote machinesStop-RemoteProcess can be used alone or in conjunction with Get-Process.
Parameters
- ID The process ID (PID) of the process to halt. This parameter cannot be used in conjunction with the -Name parameter.
- Name The name of the process to halt. Wildcards are not supported and exact process names must be used. This parameter cannot be used in conjunction with the -ID parameter.
- ComputerName The computer on which to halt the process.
- Credential The credentials under which to halt the process.
Inputs
Stop-RemoteProcess accepts as pipeline input any object with a PID or ID parameter.Outputs
Stop-RemoteProcess does not output any PowerShell objects.Notes
The cmdlet requires that the Remote Registry and RPC services are started on the computer it is trying to access and that DNS services are available to resolve target host names.Example 1
This command will halt any notepad processes on the remote computer PC01:C:\PS>Stop-RemoteProcess -Name Notepad -ComputerName PC01
Example 2
Stop-RemoteProcess can be used in conjunction with the Get-Process cmdlet. This command will halt any notepad processes on the remote computer PC01:C:\PS>Get-Process Notepad -Computer PC01 | Stop-RemoteProcess
Example 3
Stop-RemoteProcess does not translate wildcards in process names, but wildcard searches can still be performed using Get-Process to discover processes on the remote computer. This command will halt any processes with names that start "Note" on remote computer PC01:C:\PS>Get-Process Note* -Computer PC01 | Stop-RemoteProcess