Skip to content

Conversation

chetnadev
Copy link
Contributor

This script is used in ServiceNow to remove the admin role from all users except the one running the script. It's typically used during a security audit or access cleanup to ensure that only authorized users retain administrative access. By targeting the sys_user_has_role table and checking for the admin role, it deletes role assignments for all users except the current user, helping reduce the risk of unauthorized changes or privilege misuse in the system.

@ravichandra1998g ravichandra1998g self-assigned this Oct 6, 2025
Copy link
Contributor

@ravichandra1998g ravichandra1998g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @chetnadev

Thanks for your submission.

For Hacktoberfest, we’re aiming for high-quality contributions providing real-world developer usecases.

I’m marking this PR as accepted, but it will not be merged at this stage.
You can check some of the recently merged code snippets for reference. They are good examples of what we're aiming for.

As a reminder, please note:

Quality Over Quantity: Low-effort will be marked accordingly.
Expanded Snippets: Code snippets reused from the ServiceNow Documentation or API References are acceptable only if they are expanded in a meaningful way (e.g., with additional context, documentation, or variations). Remember: "QUANTITY IS FUN, QUALITY IS KEY."

@ravichandra1998g ravichandra1998g added the hacktoberfest-accepted The PR is accepted for Hacktoberfest, regardless of being merged or not label Oct 6, 2025
@chetnadev chetnadev deleted the fxhack branch October 6, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted The PR is accepted for Hacktoberfest, regardless of being merged or not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants