How about using the right() function
code:

$Check = right($groupname,3)
use x: \\Server\$check

_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!