Such a script would have to go into a logon script.
But there are a couple of questions to be answered, the more important one being the one on security.
A logon script runs normally under the user's credentials, which means the user would need to have the authority to cancel open sessions.
With the later Horizon View module, you at least can connect from anywhere, no more need to run such a script on a Connection Server.
But afaik, there are no examples of such a script in the wild :smileygrin: