It should throw an error on If SessionType() = "CtxMtHost" if the UDF is not included or called earlier in the script. Somehow it returns CtxMtHost and continues the script. Unfortunately I cannot test anything Citrix related anymore. I also do not see anything in the code that may cause this.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.