We need to remove user subscription from the sys_user_set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @NagaNandini N ,
I would not recommend deleting users directly from sys_user_set through a script.
The RR_User Subscription record is condition-based, so the correct approach is to exclude inactive users in the user-set condition itself.
Open:
RR_User Subscription
Then update the Conditions to include:
Active is true
AND
your existing role conditions.
For example:
Active is true
AND
(
Roles is itil
OR
Roles is asset
OR
Roles is <other required role>
)
This ensures that only active users qualify for the subscription user set. Once a user becomes inactive, the user will no longer match the subscription condition.
So instead of writing a Scheduled Job or GlideRecord script to delete subscription users, control membership through the Subscription User Set condition.
Also verify that the OR conditions are grouped correctly, otherwise Active = true may not apply to every role condition.
I would avoid directly deleting records from subscription/licensing tables because those records are managed by Subscription Management and direct manipulation can cause incorrect licensing data.
If you are on a newer ServiceNow release where Subscription User Sets have been converted to Groups, then update the corresponding group membership/licensing design instead of modifying the legacy sys_user_set records.
Hope this helps!
If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.
Kind Regards,
Abhishek Pal