Script Below works
BUT
The problem is the requirement to have a vailid DISPLAY variable set in the environment, not a prob if you are on an X display, but most of the use of a 'cli' is the ability to schedule or run the command if you dont have an X display !!!.
There could be several ways round it
1. set the Xserverhostname to a always running X Server. Openview console, friendly Unix user. To my knowledge nothing appears on the Xserver It just needs to check it exists.
2. find some clever Solaris way to run an Xserver without a real display.
3. vnc (freeware) might help, just thought of that!
4. Get Cisco to remove this silly requirement, as nothing appears, not even an empty window.
Script - works if Xserver running on Xserverhostname
DISPLAY=Xserverhostname:0 ; export DISPLAY
/opt/CSCOpx/bin/ut -cli -host cw2kserver -port 1741 -query all -export /tmp/export.txt username password