Get the client IP address

Copper Contributor

Hi all,

In our current environment we're using thin clients at several sites, connecting to a Citrix farm. By making calls to wtsapi32.dll, we retrieve the IP address of the thin client, which enables us to determine its physical location and do all kinds of stuff specific for that location, including mapping printers and drives, but also logging for tracing and accountability.
Using the Remote Desktop app for WVD however, the client IP address is never returned. It designates the IP address family as AF_UNSPEC.
I can understand why the wtsapi32.dll does not work in this scenario, since the client does not directly connect to the WVD, but is there another way to retrieve the client IP address? It's important it can be read from within the context and session of the user. 



2 Replies

@Donkz Did you ever figure out how to get the client IP address from WVD?  We are currently having the same issues.

@Paul Stokes Hi Paul. Sorry for the late response. I only just saw your reply and question. :smile:
No, I didn't find a native solution yet - you perhaps? :smile: - but I was able to work around it for the most important environment because of the thin clients we use (IGELs). IGEL has a central on-premise management server, with an API, so I have made a script which does an API call to retrieve the IP address from the management server for the client (CLIENTNAME environment variable).
Not ideal, but it works. 

Our thin clients are not registered in DNS, or else that would have been a Plan B. That should also work for Windows clients, als long as they're on the corporate network.