Quote:

Oke but what I need is the exact group name. Not a loop.




A login is going to be a member of more than one group. You need the loop so that you can check for file mappings for all the groups that the login is a member of.

Call the ConnectGroupDrives() for each group that is returned.