How to filter active directory group from sys_user table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 04:12 PM
Hello,
We would like to see only the users that are in specific Active Directory Group from Catalog Item variable Request For.
It is possible to filter the active directory group from sys_user table? Please advise! Thank you
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 06:16 PM
Hi
If you are setting the value for source then you can use that to identify the active_directory groups and your RQ would be
Source is <ACTIVE DIRECTOR SOURCE>
In case source is not being set then you can apply RQ on Created by. The Groups created by AD contains the name of AD service account that we use to establish the integration. So your RQ would be
Created by is <AD SERVIE ACCOUNT NAME>
Please check above two fields to see which works well.
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 10:35 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 07:55 PM
You can do an advance reference qualifier with below script [Replace NAME OF GROUP with actual group name in line #2]:
javascript: var userArray = []; var groupMemberGr = new GlideRecord("sys_user_grmember");
groupMemberGr.addQuery("group.name", "NAME OF GROUP");
groupMemberGr.addQuery("user", gs.getUserID());
groupMemberGr.query();
while(groupMemberGr.next()){
userArray.push(groupMemberGr.getValue('user'));
}
'sys_idIN'+userArray.join(',');
Hope that helps!
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 08:43 AM
Hello Muhammad,
Let me clarify what we need help with. We created an Active Directory Group called G_SECURITY. The AD group has a few members in it.
We want to only show members of the G_SECURITY AD Group in this Request For field. It that possible?
Again, thank you for helping