Check if a user was present in a group or not

Archana Singh1
Tera Expert

Hello All,

I wish to know can we check if a particular user was previously present in a group or not.

Thanks in advance,

Archana Singh

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi Archana,



In order to check whether a particular member was a part of group or not you need to navigate to that User profile. Right click on the form header and then click on History-->List as shown below:



find_real_file.png



If you are not able to see the List option highlighted above in User profile then you need to Turn the Auditing for the user Table as per the steps mentioned below:



1) Navigate to "Dictionary" under System Definition.


2) Search Table = "sys_user" and scroll down to find the below entry highlighted in the screenshot:



find_real_file.png



3)Open the Record highlighted above and click on the Auditing check box to mark it as True as shown below:



find_real_file.png



Once the Auditing has been turned on follow the below steps to check on your requirement:



Post click on the List scroll down to the "Audit History" tab and check for the Label/Type as "relation" as shown below:



find_real_file.png



Open the particular Relation record where you can find the name of the Group from which the user was removed as shown below:



find_real_file.png




Hope this helps. Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Archana,



you can determine whether the user is currently part of some group. not sure whether you can determine his/her earlier groups.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

amlanpal
Kilo Sage

Hi Archana,



You need to query in the Group Members (sys_user_grmember) table and check whether the user is present in any record. If so, than the user is a member of the corresponding group.



I hope this helps.Please mark correct/helpful based on impact



JimmieOdelius
Tera Expert

Hi Archana.



Group membership is saved on the sys_user_grmember table. Unfortunately when a group membership is removed, so is the record on the sys_user_grmember table making it impossible to see if they've been members earlier that way.



I am not aware of any pre-existing metric measuring removal and adding of records to the table but I am certain that such a metric can be developed. I have not done so however and cannot assist you with that.


shloke04
Kilo Patron

Hi Archana,



In order to check whether a particular member was a part of group or not you need to navigate to that User profile. Right click on the form header and then click on History-->List as shown below:



find_real_file.png



If you are not able to see the List option highlighted above in User profile then you need to Turn the Auditing for the user Table as per the steps mentioned below:



1) Navigate to "Dictionary" under System Definition.


2) Search Table = "sys_user" and scroll down to find the below entry highlighted in the screenshot:



find_real_file.png



3)Open the Record highlighted above and click on the Auditing check box to mark it as True as shown below:



find_real_file.png



Once the Auditing has been turned on follow the below steps to check on your requirement:



Post click on the List scroll down to the "Audit History" tab and check for the Label/Type as "relation" as shown below:



find_real_file.png



Open the particular Relation record where you can find the name of the Group from which the user was removed as shown below:



find_real_file.png




Hope this helps. Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke