question

ChristianErdtmann-7601 avatar image
0 Votes"
ChristianErdtmann-7601 asked ChristianErdtmann-7601 edited

Stay Logged in on Server after closed Remotedesktopconnection - INPUT SIMULATION Error

Hey i have written a software in C# and run it on a windows server 2019.

I trying to navigate with:
inputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.TAB);
in the Explorer.


Error:
System.Exception: 'Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.'

The reason for that i have now found out is, that after i close my remotedesktop connection, it looks like the Server disconnect my profile and log me off.
So when iam logged off i cant navigate with the Input Simulator over the Explorer.

Do someone know a way to stop the logoff from the server if i close my remotedesktopconnection.

I have allready set the limits at Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time Limits
and for User Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time Limits
in gpedit.msc

But this does not worked.

dotnet-csharpwindows-serverremote-desktop-services
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.

0 Answers