Remove License for a user

kuttti
Kilo Guru

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!

4 REPLIES 4

Saiganeshraja
Kilo Sage
Kilo Sage

 // 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.

@Saiganeshraja I do not want to delete role , I want to know if removing a role for a user reduces license cost ? Do we have to look for any other parameters ?

 

Thanks!

It doesn't delete the role , only removes the role to the users who matches query condition.It is has role table.

Hi Kutti,

Mark correct and close the thread.