Remove License for a user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2022 08:13 PM
Hello Community,
I have a quick , how do you remove a license for a user for instance we have role "ABC", which is licensable and that role is assigned to some 56 users so if we want to reduce the license cost as we are overage for license so just removing role to these 56 users help us to solve the issue.
Any help is appreciated!
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2022 09:06 PM
// This delete the has role record for the particular role.
var gr = new GlideRecord('sys_user_has_role');
gr.addEncodedQuery('role=sys_id of the role');
gr.query();
gr.deleteMultiple();
Mark correct, if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2022 09:17 PM
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2022 09:28 PM
It doesn't delete the role , only removes the role to the users who matches query condition.It is has role table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2022 10:08 PM
Hi Kutti,
Mark correct and close the thread.