Get the client IP address

%3CLINGO-SUB%20id%3D%22lingo-sub-2220810%22%20slang%3D%22en-US%22%3EGet%20the%20client%20IP%20address%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2220810%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20our%20current%20environment%20we're%20using%20thin%20clients%20at%20several%20sites%2C%20connecting%20to%20a%20Citrix%20farm.%20By%20making%20calls%20to%20wtsapi32.dll%2C%20we%20retrieve%20the%20IP%20address%20of%20the%20thin%20client%2C%20which%20enables%20us%20to%20determine%20its%20physical%20location%20and%20do%20all%20kinds%20of%20stuff%20specific%20for%20that%20location%2C%20including%20mapping%20printers%20and%20drives%2C%20but%20also%20logging%20for%20tracing%20and%20accountability.%3CBR%20%2F%3EUsing%20the%20Remote%20Desktop%20app%20for%20WVD%20however%2C%20the%20client%20IP%20address%20is%20never%20returned.%20It%20designates%20the%20IP%20address%20family%20as%20AF_UNSPEC.%3CBR%20%2F%3EIs%20there%20another%20way%20to%20retrieve%20the%20client%20IP%20address%3F%20It's%20important%20it%20can%20be%20read%20from%20within%20the%20context%20and%20session%20of%20the%20user.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional 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. 



0 Replies