ICAConnect is a commandline tool which can be used to connect to a XenApp 6.5 (an lower) Farm. XenApp versions 7 and above have not been tested with this tool. To read more about this tool, read this post.
To disconnect a terminal server session, the command TSDiscon can be used. The problem in Citrix environments, is that TSDiscon will disconnect the session, but will leave the Citrix Receiver running. CTXDiscon a small commandline tool which disconnects the current Citrix session and closes the Citrix Receiver on the end-point device. To read more about this tool, visit this post.