I'm sick of waiting for Apple to come up with a fix to trying to mount a volume in 10.7 while logged in as root so I came up with my own solution.
cat >/tmp/mountVolume.sh <<-"EOF" osascript -e 'mount volume "afp://username:password@server/path/"' EOF chmod 755 /tmp/mountVolume.sh su -l guest /tmp/mountVolume.sh rm -f /tmp/mountVolume.sh
Mac OS X Hints
http://hints.macworld.com/article.php?story=20120106082818768