Dannis Damen, one of the two DADE Power Tools guys (see their other tools) and an employee of Login Consultants has created free utility called ReconnAct! that runs on a Terminal Server and creates two environment variables: CURRENT_CLIENTIP and CURRENT_CLIENTNAME. These variables are automatically updated when a user connects from a different client.
To use this tool, you simply add a small 18kb executable called ReconnAct!.exe to the users’ or servers’ logon scripts. This process writes the two environment variables and updates them whenever one changes.
The best part is that you can also configure this tool to run a process (script, executable, etc.) whenever one of these parameters changes, so we finally have a way to update printer mappings when users log on from other workstations!