that post did not work eather. They must be stripping out the spaces when posting. Anyway, go though your script and close all your if's with endif's. (I added 4 endif's) I like to space in 3 the next line after a if so I can see to close it. That works good until you several pages and 4 to 5 if's deep.
Example:
(I used dots insted of spaces because the spaces get striped out when posting.)
$group="Grp_Qa_Prodstaging"
if ingroup($group)
...use k: "server2\production staging"
...use l: "server2\quality"
endif