Removing users from a group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 06:31 PM
Hello All.
I have a requirement where I need to remove around 100 users from the a group. The Only way I know is editing the group Members/editing a collection list.
This becomes a manual process. Is there any other method I can use? I am thinking in lines of a fix script.
TIA
Prerna
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 06:38 PM
Hi Prerna
1) If request is generated for this in system via service catalog, where you will have a list of users in list collector variable, this can be used to automate the process
2) If you just simply have a XLS or CSV file via which you want to do it, i would suggest manual operation is the best way to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 06:41 PM
Hey Deepak,
All I have is a CSV file. But manually removing around 100 users doesn't sound efficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 06:43 PM
Also I need to add these users to a new group now. I was thinking a script where I change the associated field to point to a new group than old group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 06:55 PM
Hi Prerna,
User membership to groups is stored in ServiceNow in m2m table "sys_user_grmember"
Things we are trying to achieve would have been best possible to do via "service request" wherein we will have a variable of reference type pointing toward sys_user_group table and other variable of list collector type pointing towards sys_user table. In that way, we could have written a script by using sys_ids of users and groups which are unique in system.
Now in your case, this totally depends on how your XLS sheet is given to you and its reliability, validity of data in it. This can still be possible by using import set scripting but your xls sheet must have some unique identifier for each record in it like group and user using which this can be done.