We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e026d5b commit ceb19a6Copy full SHA for ceb19a6
Server-Side Components/Background Scripts/MemberLessGroups/MemberLessGroups.js
@@ -0,0 +1,13 @@
1
+var arr=[]; //empty array that can be used later to capture the group names
2
+var gr = new GlideRecord("sys_user_group");
3
+gr.addActiveQuery();//active query to capture to query through all the active groups
4
+gr.query();
5
+while(gr.next()){
6
+ var br= new GlideRecord("sys_user_grmember"); //querying grmember table to validate group's members
7
+ br.addQuery("group",gr.sys_id.toString());
8
+ br.query();
9
+ if(!br.hasNext()){ // if no member then capture the group name in the array
10
+ arr.push(gr.name.toString());
11
+ }
12
+}
13
+gs.print(arr.join(",")); //printing the array with all the memberless group names
0 commit comments