• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 738
  • Last Modified:

Microsoft TS - Start Program on another session


Is it possible for me as an administrator to start for example "notepad.exe" inside another users terminal server session so that it shows on the users screen?


3 Solutions
MarcusSjogrenAuthor Commented:
Thanks BlueYonder, but I think I was a bit unclear.

I want to start it from my own command prompt without having to log on or remote controlling the users session.

My bad!


You can use psexec to start programs interactively in the console session, which users don't see or, having their credentials, in their own session. Without their creds (you don't have those, right?), you can only schedule tasks that are configured to run only if those people are logged on and use their session, not sure if that works. Try it.
What is the use case?
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

MarcusSjogrenAuthor Commented:
Thank you very much for the idea about task schedule!

The task is to say - open TeamViewer automatically when the user needs help, or to run an inventory tool on the users account.

I have no straight idea about it - I am working with developement so this was sort of a first step to see if there was any idea of even trying :-)

I will test the task scheduler and get back to you!
Venugopal NCommented:
Try with psexec command.


To run something on a remote machine (with a user logged on):

psexec \\<ip address> -u <user> -p <password> -i 0 -d "<local path to executable>"

-i 0    runs on main screen

-d      don't wait for command to complete on remote machine
MarcusSjogrenAuthor Commented:
cheers, will absolutely test it!

Thanks Venougopal N!
Mind what I wrote about psexec. A TS is not used at session 0.
MarcusSjogrenAuthor Commented:
Hi all,

I believe I have resolved the issue now!

Since I don't really care (for now at least) if the program runs as the target user I got it working by the below PsExec-command.

What I noticed was that without -e and with local administrator it started but did not show the notepad GUI. Adding -e and domain administrator resolved that issue.

-i = the users terminals service session ID
-d = don't wait for process to execute
-e = don't load executing users profile
-u = Username
-p = Password

C:\PSTools>PsExec.exe -i 12 -d -e -u "DOMAIN\administrator" -p "PASSWORD" "

PsExec v2.1 - Execute processes remotely
Copyright (C) 2001-2013 Mark Russinovich
Sysinternals - www.sysinternals.com

C:\windows\notepad.exe started on TS1 with process ID 35608.
MarcusSjogrenAuthor Commented:
I found that it is indeed possible to start a program on another users session when being the domain administrator and not loading the administrator user profile.

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now