how to provide security admin role to a user using script in servicenow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 01:10 AM
We have a security admin group and from script i am trying to add a member in the group.
for this i am first creating one record in sysevent table then i am adding the user to the particular group using script still no luck.
@Ankur Bawiskar any suggestions?
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 01:19 AM - edited 03-10-2023 01:19 AM
I don't think this is going to work.
Only someone with Security Admin role can give another user Security Admin Role.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 01:25 AM
Hello Debasis,
No script needed.
Even if you have the security_admin role, you need to elevate your role first to give others the role / add others to that group.
First elevate your role and then give it.
Mark as correct and helpful if it solved your query.
Regards,
Vaibhav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 01:35 AM
I won't recommend using script for giving security_admin role to some group/user.
Let the security_admin role user do this task.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 01:39 AM
the user i am using for this is a security admin role only i am trying to automate this process that is why using script