remote start application by powershell

Yendy Hui 21 Reputation points
2020-08-27T07:52:04.287+00:00

I access to remote computer via ssh and running powershell as AS to execute the following command but I can't see the Notepad++ running on remote computer.

Invoke-Item -Path C:\Users\Dex\Desktop\Notepad++.lnk

or

Start-Process -FilePath C:\Users\DDhami\Desktop\Notepad++.lnk

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,546 questions
0 comments No comments
{count} votes

Accepted answer
  1. SethWH 436 Reputation points
    2020-08-31T17:36:40.1+00:00

    Let me give you an example with Notepad:

    Query the remote server to find the session ID you want to start a program in:

    PsExec  \\MyServer01 -u Administrator -p MyPassword query session
    

    A list of session IDs will be displayed so look for the RDP or console session ID you want to start Notepad in. In my example, my RDP session is ID 2. Run the following command to start notepad remotely:

    psexec \\MyServer01 -u Administrator -p MyPassword -d -i 2 C:\Windows\System32\notepad.exe
    

    If you receive a message like "notepad.exe started on MyServer01 with process ID XXXX," check the remote session to verify notepad is open on the desktop.


1 additional answer

Sort by: Most helpful
  1. SethWH 436 Reputation points
    2020-08-27T16:13:13.043+00:00

    Notepad++ will probably be visible in the Task Manager but not on your Desktop or RDP session. You can find more information here:

    powershell-using-start-process-in-pssession-to-open-notepad

    psexec is tool you could use though.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.