Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell if my application is running in an RDP session

Tags:

.net

winforms

rdp

I have a .net winforms app which has a few animation effects, fade ins and scroll animations etc. These work fine however if I'm in a Remote Desktop Protocol session the animations start to grate.

Can someone suggest a way of determining whether or not an app is running across an RDP session so I can turn the effects off in this case?

like image 644
Christopher Edwards Avatar asked Nov 17 '08 11:11

Christopher Edwards


People also ask

How can I tell if an RDP session is active?

If you want to know which types of connections are used to connect to the remote, simply click on any column of the list, say "Status," then right-click on it and select "Session." The list will then show a session column with the types of connections to remote, such as console, terminal, services, or RDP, and so on.

Can you detect RDP?

Detection. Detecting the use of RDP is something that is captured in several logs within a Microsoft Windows environment. Unfortunately, most organizations do not have a log management or SIEM solution to collect the logs that could alert to misuse, furthering the challenge to organizations to secure RDP.

What runs with RDP?

Clients exist for most versions of Microsoft Windows (including Windows Mobile), Linux (for example Remmina), Unix, macOS, iOS, Android, and other operating systems. RDP servers are built into Windows operating systems; an RDP server for Unix and OS X also exists (for example xrdp).


1 Answers

Assuming you're at least on .NET Framework 2.0, there's no need to use P/Invoke: just check the value of System.Windows.Forms.SystemInformation.TerminalServerSession (MSDN).

like image 109
Arnout Avatar answered Oct 10 '22 04:10

Arnout