Reading a users RDP Session ID from C#

G

Guest

If a user is logged onto a remote Terminal Server is there some way to read a
unique identifier on both the client side and TS machine which uniquely
identifies the RDP client and Server connection?

On the client side I need to write a C# Winform application that can
communicate the user's RDP unique identifier back to a web service interface
and use it for additional processing unique to the RDP session of the user
running in the IE browser ActiveX RDP client.

Is this possible? Do you happen to have any code snippets showing how to do
this? If no code, can you describe how I might do it in enough detail I can
follow through. I'm not too sharp, so you'd need to be fairly detailed with
instructions.

Thanks very much for any help you can provide.

Also, if out of scope here, can you recommend another source within
Microsoft that might be able to help?

Thanks,
 
L

Luke Zhang [MSFT]

Hello Mike,

You may use the System.Diagnostics.Process' SessionId property, which
returns the Terminal Services session identifier for the associated process:

http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.sessioni
d(VS.80).aspx

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

At first glance, this appears to only work on the Terminal server.

How do I get the SessionID on the client side; and in a separate, C# Winform
application that is not related in any way to the remote RDP session?

Thanks very much for your help.
 
L

Luke Zhang [MSFT]

Hello,

For such a situation, .NET framework didn't provide a way. You need WTS
API, as described in wtsapi32.h within the platform SDK. I suggest you may
post this issue in following newsgroups:

microsoft.public.windowsnt.terminalserver.protocols.rdp
microsoft.public.windowsnt.terminalserver.applications

There may be someone has done this before there.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Luke, .application does not exist over in
microsoft.public.windowsnt.terminalserver.*

I posted it to .rdp and .user, but they are currently empty except for my
question.

What options do I have to get additional Microsoft Professional Services to
help with this question?
 
L

Luke Zhang [MSFT]

Hello Mike,

Creating a PSS support incident should be the most prompt way to get a
solution. to submit a support incident:

http://www.microsoft.com/services/microsoftservices/srv_support.mspx

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top