I would then use the UDF DirPlus or something similar to get an array of directories. then...
untested
Code:

$UNC = "\\server\share"
$dirArray = dirplus($UNC,"/ad")

for each $dir in $DirArray
$Group = 'TNT\' + $dir
If InGroup($Group)
Use R: $Server1 + $dir
EndIf
next



Actually I would use one of the MapDrive UDF for the actual mapping.
_________________________
Home page: http://www.kixhelp.com/hb/