The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Remove empty user from sys_user_has_role

Vasu1
Mega Contributor

Help requested

How to remove (empty) user from sys_user_has role.list? 

we recently cloned from prod to sub instance dev and in sys_user_has_role.list found empty(25) records. 

1 ACCEPTED SOLUTION

without doing any changes in ACL the only option is , use background script to update it to false. eg:



var gr = new GlideRecord('sys_user_has_role');

gr.addEncodedQuery('user=22d0ed7fdb08b300798979e49f961977');
gr.query();
while(gr.next()){
gr.inherited=false;

gr.setWorkflow(false);

gr.update();
}

 

Now you will able to see the delete button on that record as well list , but on list name will be like "Remove user access from table"

 

Screenshot for reference. 

 

find_real_file.png

 

 

 

View solution in original post

16 REPLIES 16

let me know if you need any further help here. 

 

If your query has solved, kindly mark the answer as correct and close this thread. 

Jaspal Singh
Mega Patron
Mega Patron

Hi Srinivas,

 

Seems its duplicate of thread https://community.servicenow.com/community?id=community_question&sys_id=3e739433db5e5c9066f1d9d96896... kindly avoid duplicating threads for similar issues.

sachin_namjoshi
Kilo Patron
Kilo Patron

This means these users are not available in your sub prod instance.

 

Regards,

Sachin

Anurag Tripathi
Mega Patron
Mega Patron

If its just 25 records, and it is a one time activity, and its not even prod.

Why dont just do it manually?

-Anurag

Hi Anurag,

Am not seeing option to delete or remove manually in sys_user_has_role.list. 

 

Thanks

Srinivas