Powershell - Remote Administration

I created the following Powershell scripts. One to kill a process, the other to launch a process on a remote machine. Both scripts work (remotely and locally), however the launch script starts the process (I can see it in the task manager) but there’s no visible window or runs without launching a process and produces no error.

I have set the executionpolicy to bypass and tried various versions of the script but can’t seem to get it to launch any application with a window. I have also Enabled-PSRemoting.

#Kill Process

Invoke-Command –ComputerName mamba -credential administrator –ScriptBlock {Get-Process "notepad" | Stop-Process -force}


Enter-PSSession mamba get-process “notepad” | Stop-Process –force

#Start Process

Invoke-Command -ComputerName mamba -Credential administrator -scriptblock {start-process "notepad"} (runs without error but does not launch a process)


Invoke-Command -ComputerName mamba -scriptblock {start-process "notepad"} (runs without error but does not launch a process)


Enter-PSSession mamba start-process “notepad”  (process launches but no window)

What am I doing wrong? Thank you ahead of time for your feedback!

Do you use the same account to launch a process you use to logon to Windows? If not there will not be a visible representation of the process because it runs in another session.

Using the -ComputerName only creates a temporary session to the computer and then closes the session, thus, closing the process when being called. To create the process and do stuff while the connection is established, use the -Session parameter when calling Invoke-Command.

$Session = New-PSSession -ComputerName server1 -Name server1
Invoke-Command -Session $Session -ScriptBlock {Start-Process Notepad -Passthru}

The -Passthru parameter will return what the command output was.

Hope this helps.


Thanks for the advice. I was able to finally get the process to launch but had to first create a scheduled task then call it remotely using Powershell. Apparently, PS forbids you to launch applications on a remote computer directly.