Sorry for the delay.

I ran the script on debug mode.
It seems that the function works even though that i didn't write it in the script and the function recognize "CtxMtHost" as a session type cause it keeps runing to the next command which is "$session = GetSessionID()"

Is there a command i can add to the script that will display the value in the "SessionType()" function?

I tried adding this:
 Code:
Dim $a = SessionType()
? $a


and i get an error.
ERROR : unexpected command!
Script: \\172.30.168.229\netlogon\IL-CAR\citrixdefaultprinter.kix
Line : 5