2

How do I prevent user from opening multiple instances of an executable on the server (Windows 2008 R2). For example we have users opening a program installed on the server from their PC's (Windows 7 Enterprise); in many cases they open the executable go to a different location and open the executable again on another PC. This creates multiple instances which causes more then one license to be used by that user.

** I was just told the problem has been solved. One of the Process Engineers created a program that identified all running instances and can close an instance out on command. This is still a manual way to fix the problem however but I don't make those decisions. Thank you to all that have contributed.

RCawdor
  • 21
  • 1
  • 4
  • It sounds like you've set the server to allow multiple remote desktop sessions from the same user. Forcing users to use only one session will make it so that they'll take over their abandoned session instead of creating a new one when logging in from a new location. – austinian Sep 23 '15 at 21:14
  • Yes, but we want them to be able to do that. What we don't want is the user to open multiple instances/threads for one particular program. It is hard to explain as I am second party in helping to find a solution. – RCawdor Sep 24 '15 at 17:52
  • When the users launch this program... does the executable actually run (i.e. a process, an *.exe is created in Task Manager,) on the user's PC, or does it run on the server? I'm not quite understanding what's going on. This "licensing" hocus-pocus is not uncommon in business software, but it sounds like your software vendor implemented it particularly poorly. – Ryan Ries Sep 25 '15 at 02:08
  • It's a per instance license. Some publishers use this because users will sometimes run multiple instances of the software at once on the same machine, so each instance is counted as a license usage. SketchUp, at least versions 7, 8, and 9, used this. So one user on their desktop could take up all the shared licenses by launching the program multiple times. It's more often by-design than a poor implementation. – austinian Sep 25 '15 at 08:13
  • I would contend that allowing one employee to DoS everyone else with minimal effort is very poor design. It would be very easy for me to design something for you that would only allow a user to launch one instance of an application at a time on a machine, but the user could still go to other machines and launch the app on those PCs. The only way to stop that is a more intelligent network license server. Which your software vendor forgot to implement. – Ryan Ries Sep 25 '15 at 13:44
  • Just what Austinian said. I was just told the problem has been solved. One of the Process Engineers created a program that identified all running instances and can close an instance out on command. This is still a manual way to fix the problem however but I don't make those decisions. Thank you to all that have contributed. I still think this is a good question for discussion however as others may run into similar issues. – RCawdor Sep 25 '15 at 13:59

2 Answers2

2

Run tsconfig.msc and set "Restrict each user to a single session" to Yes.

Greg Askew
  • 34,339
  • 3
  • 52
  • 81
  • Thank you for the reply but we want them to be able to login multiple times, we just don't want them to be able to have multiple instances/threads opening for one particular program by the same user. I am having a hard time explaining exactly what I am trying to do and for that I apologize. – RCawdor Sep 24 '15 at 17:49
  • 1
    There isn't a reliable way to enforce this. It would be possible to create a script that launches the application, check first if there are any instances open. But that would not prevent it from being launched directly. – Greg Askew Sep 25 '15 at 19:28
1

I would replace the shortcut to the program with a shortcut to a launcher script. The launcher script would check to see if the process has been launched by the user launching the script. If yes, then give the user the option to kill the process, or just show a message that the user cannot launch again.

I'm looking for ways to script switching moving the running program to the current session, but I haven't found luck down that route yet. The best I can come up with is using an option message to ask the user if they want to switch to the session with the program running, and if yes, use tscon <session id> /v to switch the user to that session.

Related: Connecting to specific session using remote desktop

austinian
  • 1,699
  • 2
  • 15
  • 29