Sub macro_groups()
Dim objNetwork, objUser, Usr_groups
Set objNetwork = CreateObject("WScript.Network")
strUsername = objNetwork.UserDomain & "/" & objNetwork.Username
strUsername = Replace(strUsername, "\", "/")
Set objUser = GetObject("WinNT://" & strUsername & ",user")
Set Usr_groups = objUser.groups
End Sub
That will return all the groups the user is part of to the Usr_groups object variable. I think that normally you would then test if a user is part of a certain group, rather than return which group the user is part of. As Izandol says you would normally be a member of many groups, for example, when I run that on my machine Usr_groups has 13 different items.