# Remote Desktop Services - Thin Clients Name

**URL:** <https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427>\
**Category:** Ignition\
**Created:** [June 8, 2020, 6:32pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427 "2020-06-08T18:32:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [June 8, 2020, 6:32pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427/1 "2020-06-08T18:32:58Z")

</div>

I am utilizing Remote Desktop services (Terminal Services) on a Server 2019 VM. I need to be able to get the Client’s name from terminal services as I can’t use Client HostName or IP address as that is the same for all clients as it reports the RDS Server info. I need to differentiate between the clients to auto-login certain default users on certain clients.

I am hoping I can get this info in Python behind the scenes but not sure where to look.

I have done this in another unnamed SCADA package before - but they have built-in script  
TseGetClientNodeName( ) - which returns the terminal services client name.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2020, 6:39pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427/2 "2020-06-08T18:39:11Z")

</div>

Some quick googling suggests the CLIENTNAME and SESSIONNAME environment variables may have useful values in them.

```auto
from java.lang import System

print System.getenv("CLIENTNAME")

```

If that doesn’t work I’m not sure, maybe someone more familiar with WTS/RDS has a better idea.

---

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [June 8, 2020, 6:47pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427/3 "2020-06-08T18:47:53Z")

</div>

Thanks Kevin that worked. - I searched on google for about an hour but was searching the wrong way 🙂 I was searching python to get back the TS user name - never dawned on me to try searching Java scripts.

Thanks -

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2020, 6:50pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427/4 "2020-06-08T18:50:37Z")

</div>

You can do this with python too using `os.environ`. I just always reach for Java APIs because that’s what I know better.

---

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [June 8, 2020, 8:01pm UTC](https://forum.inductiveautomation.com/t/remote-desktop-services-thin-clients-name/35427/5 "2020-06-08T20:01:35Z")

</div>

Ok thanks.

I was trying to use os.environ but was failing - I did finally get that to work as well was missing the [] outside of the variable.

```auto
import os
print os.environ[('CLIENTNAME')]

```
