Solution: use pam_group.so
On system startup create a /etc/security/group.conf based on hostname.
Add the following to /etc/pam.d/gdm
Code:
auth optional pam_group.so
This tells gdm to use the settings in /etc/security/group.conf
For our purpose we needed the students to be assigned to a group based on which computer lab they are in. The computers in each lab have a unique hostname so we use this to generate /etc/security/group.conf on bootup.