Normally the property MaschineName of the class Environment contains the NetBIOS name of the pc. If the user runs the application in a Citrix environment, it contains the name of the Citrix server which hosts the current session.
In my application this behavior led some settings of some user to be overwritten by another user, because it was actually the same pc / server. And unfortunately it costs me a lot of time to figure out.
The avoid this, the environment variable CLIENTNAME can be used. In a Citrix session this variable is not null and contains the NetBIOS name of the pc.
String mName = Environment.GetEnvironmentVariable("CLIENTNAME") ?? Environment.MachineName;