Another solution is to use the CTXCINFO.EXE program I cobbled together some time ago to return client information, or Howard Bullocks helper DLLs.

The former definately returns the client name, and I suspect the latter does too.

The site that used to host ctxcinfo.exe is no longer available, so if you want it let me know and I will post it to you.

It was originally documented here

Information on Howards DLL can be found in the Citrix/Terminal Server FAQ.