Query for Custom Groups

Query for Custom Groups

Hi all,
Hoping someone can point me in the right direction.
Database is postgresql.

I am trying to list all managed computers under a dynamic custom group.

Select * from resource - will return the resourceID, name, domain_netbios_name etc

I see my custom groups have a resourceID assigned and all groups returned are resource_type 101

Select * from CustomGroupMemberRel
returns back member_resource_id and group_resource_id, but neither of those fields contain the dynamic group ID's.

My APD tasks have this dynamic custom group assigned, so it knows to pick up and patch on a schedule, so surely the computername information is saved somewhere.  

What i'm ultimately trying to do is:
- identify servers NOT in any patch group, and then assign them to various groups, which then are assigned to various APD scheduled tasks.

                New to ADSelfService Plus?