Instead of using @LServer directly, check it and cast it to a var.

Also, don't use vars inside strings.

Code:
If @Lserver <> 'IM'
$LServer = @LServer
Else
$LServer = 'the right server at this site'
EndIf
...
use I: $LServer+'\common$$'


Insead of all those separate InGroup() statements that all map to the same place, put them all in one.

If InGroup('cs-office','ws-office','ms-office')

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.