I'm amazed that someone with so little knowledge of scripting, has been put in charge of script maintenance. Nevertheless, to get it to work without that error popping up there has to be someway to differentiate server from client. Are all of your servers named with a similar convention? Are they all on a separate IP range? Are they all connected over ICA so we can use sessiontype()? It is hard for us to be of more assistance when you are the only one with the Xen servers to test on.