Remove role from multiple users

neethu4
Giga Expert

Hi All,

I need to remove specific role from 3k users.I have email id as unique field.

Can i use transform map to delete the user role table record?

If i use fix script\Bg script then it is difficult to filter user with 3k email id.

Please let me know your suggestions.

 

Thanks,

Neethu

6 REPLIES 6

LisaKomidar
Giga Guru

Are you truly wanting to remove them?  Or remove access to a particular area?

 

If you are wanting to remove them, my recommendation would be to never remove users.  You want to simply set them to inactive.  This will allow your data for any related item such as incidents remain in tact.

 

You can create an excel file with the user id or email address and the active flag as false.  Upload it.  Use a simple transform map and set them to inactive.

 

Cheers.

Sorry it is not about access.I need to remove a specific role from a list of users

Hi Neethu,

Write a transform map and write onbefore script, target table would be sys_user_has_role.

if record found delete; if not found then ignore=true.

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

neethu4
Giga Expert

Sorry it is not about access.I need to remove a specific role from a list of users