The host name of the device that is connected to the terminal server is accessible via the "ClientName" environment variable. Not sure the easiest way to get the IP address.