if(Win32::AdminMisc::UserGetMiscAttributes('DOMAIN', "user", \%Hash)){ print "The user is in the primary group with a RID $Hash{USER_PRIMARY_GROUP_ID}\n"; }