1

We have a new ERP application which runs via RemoteApp. It's expensive and has a very draconian license limit. Sometimes users will mistakenly open multiple instances of it, when they are not supposed to.

However, no matter how many copies of the application a user may be running, they all run in the same user session. So, limiting the number of RDP sessions will not do the trick.

We need to limit the number of active sessions of that application that a user can use. Is there a way to do this within RemoteApp? Or, should I be looking into AppLocker?

Thanks in advance.

ltwally
  • 315
  • 2
  • 6
  • 21
  • I like where Rex is going with it, but the ERP app doesn't validate their credentials somehow and realize whether they are or aren't already logged into it? – TheCleaner Jan 23 '15 at 20:20
  • Yes, the ERP application does require credentials. But it has no provisions itself to limit the number of instances running in any fashion. – ltwally Jan 23 '15 at 20:48

1 Answers1

2

I don't think there is any built-in way to do this with RemoteApp yet. There are 3rd party tools that can likely do this (AppSense, etC).

You could also look at launching the application via a script that checks if the process is running within the user context and, if not, launches the application (or kills the other process first before launching).

A similar script was provided as an answer to this super user question
edit: and updated to include an additional filter to filter to search based on the username environment variable.

tasklist /nh /fi "imagename eq notepad.exe"/fi "username eq %userdomain%\%username%" | find /i "notepad.exe" > nul || (start notepad.exe)
Rex
  • 7,815
  • 3
  • 28
  • 44
  • Being able to do it from just regular Windows Server controls would also suffice. – ltwally Jan 23 '15 at 18:56
  • Your script seems to miss the point: only allowing our users to run one instance of said application. – ltwally Jan 23 '15 at 18:57
  • You would have to modify it to only look within the user context.. I stated the script was similar - which, to me, implies it would need to be modified to meet your purposes. For clarification, I'll update the script to search for the process based on the username. It might still require some modification depending on your environment and I haven't fully tested it as of yet. – Rex Jan 23 '15 at 20:16
  • Rex, a script like this would face several hurdles... it'd either have to be on a very very frequent timer or run every time a new process was created, it'd have to be able to determine which process is the new one, etc... I'm very much hoping for something a little more packaged and elegant. Like AppLocker or a 3rd-party service. – ltwally Jan 23 '15 at 20:45
  • No, you would set remote app to run the script instead of the exe so it runs only when the user tries to launch the app – Rex Jan 23 '15 at 21:13
  • Rex, I looked into that as well. The developer insists we not do that, citing some technical reasons. It wasn't worth arguing with them & management over, so I crossed that off my list. – ltwally Jan 23 '15 at 22:50
  • How would I restrict the number of instances of notepad.exe to `N`? If I add the `/c` flag to `find` then is there a way to pipe it to an `if` statement? – paulkon Feb 14 '17 at 07:49