Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Assign Security_admin via Scripted rest API

Vijay Baokar
Kilo Sage

Hi Folks,

I am working on automate UAM(user access management) through scripted rest API, which is working as expected but there is a scenario where we need to assign user to a group which has security_admin role.

Currently user is getting added to that group but security_admin role is not getting assigned. 

 

We have integration user who has security_admin role. I know to grant security_admin role we need to elevate it but how can we handle the session for integration user so that newly created user can be assigned to the group and its role "security_admin " as well.

4 REPLIES 4

PrashantLearnIT
Tera Sage

Hi @Vijay Baokar 

 

Any reason why you want to assign security_admin role for newly created user, what you are trying to accompolish here.

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

Hi @PrashantLearnIT we have a IT security group which everyone should not have access to. So whenever any security team need access to that group then only we need to assign them security_admin role post approval.

Note: security_admin is not for all users but only for Security team.

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Baokar 

Not a valid use-case to give security_admin via scripted REST API

You can't elevate user session to security_admin in scripted REST API

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Baokar 

you can handle this via manual intervention and don't automate this as you can't achieve this via automation.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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