question

BrianHart-9063 avatar image
0 Votes"
BrianHart-9063 asked BrianHart-9063 answered

Prevent user from having two instances of RemoteApp

Server 2019

Is there a way to prevent a user from opening multiple instances of a RemoteApp? I already have the GPO set to "Restrict Remote Desktop users to a single Remote Desktop Services session", but that is an entirely different question of whether they can open multiple instances of the RemoteApp--that all run within the same user's session.

Users regularly forget that they have a RemoteApp open and double-click the RDP file to open a new one. This ends up consuming two licenses for the application until the user closes each instance. I have a Windows 2008 server also running a RemoteApp, and it correctly takes over the first session if the user attempts to spawn a second instance of the RemoteApp.

So I figure I missed something in the configuration of my Server 2019 RDApp.

remote-desktop-services
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
We are looking forward to your feedback and ready for help.

0 Votes 0 ·
BrianHart-9063 avatar image
0 Votes"
BrianHart-9063 answered

Just to clarify: there is apparently no way within the RemoteApp configuration to prevent a user from running two instances and therefore running the application twice--simply by minimizing one and then opening another instance. It seems this must be built into the application itself. Since I am not the application developer, all I can do is go back to them and ask that they check to see if the user has an instance open before allowing another.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GraceHE-MSFT avatar image
0 Votes"
GraceHE-MSFT answered GraceHE-MSFT edited

Hi,
Thank you for posting your query. According to your description, here are some hints you may try to solve this.
Mutexes
https://docs.microsoft.com/en-us/dotnet/standard/threading/mutexes

When creating the mutex you would use the naming convention Global\\MutexName to handle terminal services scenarios.

// declare in your program
private static Mutex mutex = null;

bool createdNew;
mutex = new Mutex(true, "Global\\MutexName", out createdNew);

if (!createdNew)
{
// Application is already running, so shutdown
Application.Current.Shutdown();
}

Best Regards,
Grace

---If the suggestions above are helpful, please ACCEPT ANSWER. Really appreciate. This will also help others with similar issue to find this post quickly. ---

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BrianHart-9063 avatar image
0 Votes"
BrianHart-9063 answered

I am not the application developer, so I will go back to the application developers to ask them if they can block multiple copies per workstation. I was just hoping that the Remote Desktop App could be configured to allow only the requested application and only one instance within the session.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.