This post is the result of a request from Jose:
I have updated the Win32Admin.Zip with a new DLL and updated test scripts. A new script "LookupPrimaryGrp.kix" shows two ways how one can determine the primary group name of a user.
The first uses GetUserGroupFromRID to do a direct resolution of the RID to the name of the object identified by the RID. The RID was obtained using primary_group_id value retrieved via UserGetInfo.
The second, although it is longer, show additional methods and object that would be very useful in other applications. It uses, EnumTrustedDomains, VBS Dictionary Object (CreateObject("Scripting.Dictionary")), UserGetInfo, and LsaLookupSids.
I would be happy to answer any question about the methods of the DLL or the accompanying script.
http://home.comcast.net/~habullock/kix_solutions.htm