Is there a way to know which groups were removed for user??

rezacol
Mega Expert

Guys, I have a script which runs everyday and searches for the user who haven't logged on to the SN for 30 days. Those users are revoked from groups and roles by the script. Now I want to know is there a table where I can see which all groups or roles have been removed for a particular user??

 

Thanks in Advance,

Reza R.

1 ACCEPTED SOLUTION

Chandan23
Tera Expert

Audit Roles business rule on sys_user_has_role table and it's updating the sys_audit_table. Like wise you can develope same way a new table u_audit_group and audit group business rule.


View solution in original post

5 REPLIES 5

Slava Savitsky
Giga Sage

Removing a user from a group means deleting a record from 'sys_user_grmember' table. Revoking a role from a user means deleting a record from 'sys_user_has_role' table. By default, deletion is audited for both of these tables but you can double check that in your ServiceNow instances by looking at the value of the 'glide.ui.audit_deleted_tables' system property.



Restoring Deleted Records - ServiceNow Wiki


Chandan23
Tera Expert

Audit Roles business rule on sys_user_has_role table and it's updating the sys_audit_table. Like wise you can develope same way a new table u_audit_group and audit group business rule.


You were probably referring to 'sys_audit_role' table.


yep