# How does the scheduler find the primary group?

**URL:** <https://community.openpbs.org/t/how-does-the-scheduler-find-the-primary-group/4221>\
**Category:** Users/Site Administrators\
**Created:** [March 11, 2026, 7:06pm UTC](https://community.openpbs.org/t/how-does-the-scheduler-find-the-primary-group/4221 "2026-03-11T19:06:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [March 12, 2026, 8:07am UTC](https://community.openpbs.org/t/how-does-the-scheduler-find-the-primary-group/4221/2 "2026-03-12T08:07:29Z")

</div>

The discussion on this page might be helpful

> [@Hook to put a job in a queued based on user egroup](https://community.openpbs.org/t/hook-to-put-a-job-in-a-queued-based-on-user-egroup/2531):
>
> Hello guys, how are you doing? I’m trying to write a hook to check the user’s group parameter. If the user belongs to the “others” group, the job is moved to a specific queue (eg. test) regardless of which queue he has specified. I’m using the Hook Book as a reference, but I don’t have much knowledge in python and I’m unsure of which instruction to use on the hook to change the job’s queue . I wrote, this simple script: import sys import pbs try: e = pbs.event() j = e.job pbs.l…

> <https://github.com/openpbs/openpbs/blob/master/src/resmom/start_exec.c>

Check this: getpwnam()

Hook and wrapper scripts are the way to go.

---

_[View the full topic](https://community.openpbs.org/t/how-does-the-scheduler-find-the-primary-group/4221)._
