SynopsisStart a program or executable on a remote computer.
- Start-RemoteProcess [-CommandLine] [-ComputerName] [-Credential]
DescriptionStart-RemoteProcess is used to start executables on remote computers. It is similar to the built-in Start-Process cmdlet, but can also be used against remote machines.
The remote process will run in the context of the current user or a user specified using the credential parameter. Remote processes run in a separate non-interactive session and are not visible to desktop users.
Start-RemoteProcess can be used in conjunction with Copy-ToTemp to copy and execute programs on remote computers in a single command line.
- CommandLine The command line and any command line arguments for the process.
- ComputerName The computer on which to start the process.
- Credential The credentials to use to start the process.
InputsStart-RemoteProcess accepts the output of Copy-ToTemp as an input object and will execute the copied on the remote computer.
OutputsStart-RemoteProcess does not output any PowerShell objects.
NotesThe 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 1This command will execute the batch file c:\scripts\myscript.bat on the remote computer server01:
C:\PS>Start-RemoteProcess c:\scripts\myscript.bat -computer server01
Example 2This command will start notepad.exe on the remote computer Win7PC. However, the process will start in a non-interactive session and will not be visible on the desktop of anyone using the PC:
C:\PS>Start-RemoteProcess Notepad.exe -Computer Win7PC
Example 3Start-RemoteProcess can work in conjunction with Copy-ToTemp. This command will copy the executable beep.exe to remote computer pc01 and run it on the remote computer.:
C:\PS>Copy-ToTemp c:\MyProgram\beep.exe -Computer pc01 | Start-RemoteProcess