try:
        security_descriptor = win32security.GetNamedSecurityInfo(
            obj_name, obj_type_flag, win32security.GROUP_SECURITY_INFORMATION)
        primary_group_gid = security_descriptor.GetSecurityDescriptorGroup()