I created a tool for a customer who wanted to set the preferred tree to a different tree from the login script.
The program requires the tree name as the parameter, e.g. "PrefTree NOVELL_INC". For troubleshooting purpose, the program can show detailed messages, if the parameter "/v"("verbose") is specified as the second parameter. Without "/v" the program operates in a quiet mode, to not confuse end users with disturbing messages.
How the program works:
The user needs to be already logged into the second tree that he wants to become the primary tree (Usually from a login script or other kind of script). PrefTree.exe finds the first connected server in the specified tree and makes it the preferred server. Then the program sets the new tree as the preferred tree. If the user has the "Default Server"-attribute set, the program tries to make this server the primary server.