If you do a
code:
$primarygroup=@PRIMARYGROUP

what is the content of $primarygroup?
Then you could shorten your code to
code:
$primarygroup=@PRIMARYGROUP
USE G: "'\Server1\'+$primarygroup

BTW, the second CASE in your CASE SELECT for the legal notice is missing the parameter.
_________________________
There are two types of vessels, submarines and targets.