Creating Flow for Removal of Inactive Users

Service now11
Tera Contributor

I need to design a flow for removing inactive users based on certain conditions. The criteria for removal are as follows

and here I cant get the assignment groups in the flow

Users where:

Active = false, and
Last Updated is more than 1 month ago, and
They are members of specific groups (group memberships need to be removed).

The group memberships to be considered for removal are:

Specific group memberships
All assignment-group memberships (i.e., groups with Type = ITIL) and should log a delete actions

7 REPLIES 7

Service now11
Tera Contributor

Hi @Ankur Bawiskar 

 

I need to remove inactive users from a specific group, and also those inactive users present in all assignment groups. I’m currently stuck on creating the conditions to achieve this.

@Service now11 

please delete your other question as it's a duplicate one

Also you are already remove inactive users from specific group, the only part pending is assignment groups

Do this

1) use Lookup records on task table

2) Then use For Each and iterate and lookup on Group member with this user and the task assignment group

3) then delete the Group member record

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Mark Manders
Mega Patron

You have asked this question 3 times on the community. Why? This will run you the risk of getting the same answer multiple times. In none of the duplicate questions you mention what you already did and what you already tried.

 

The flow you show, needs to be updated to have separate look ups for the sys_user_grmember table and the sys_user_has_role  table. Because if any inactive user has a role, but no group (shouldn't happen because of best practice, but you never know), it won't remove the single role. So get the sys_user_has_role loop out of the sys_user_grmember loop.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark