Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Dump group membership

Code Block
 var ggroupName = 'CTS STC Cluster Zone 1';
 var gr = new GlideRecord('sys_user_grmembergroup');
  ggr.addQuery('name', 'CTS STC Cluster Zone 1');
 gr.query();gr.next();
 var gr_sysid = gr.sys_id;
 var g = new GlideRecord('sys_user_grmember');
  g.addQuery('group', gr_sys_id);
  g.query();
  var n=0;
  while (g.next()) {
     if (n == 0 ) {
       gs.print('members are: ');
     }
     gs.print(g.user.user_name + ';');
     n++;
  }
  gs.print(n + " members in group");