A script user in the UK reported an issue I had never thought of. If remoting is configured with the Set-XADefaultComputerName cmdlet, I never verified that server was a controller. The script cannot be run on or against a Session-only Host.
I was verifying the server running the script was a Controller but not if remoting was used. This turned out to be a very simple fix.
Even though I am hard at work on version 4.1 of the XenApp 6.5 script, I will always take the time to fix bugs in the current released scripts. This fix is also in the upcoming 4.1 script.
This is script version 4.05.
NOTE: This script is continually updated. You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/