Query to assign SDAdmin role to the administrator or to a particular user

Query to assign SDAdmin role to the administrator or to a particular user

Hi,

I am wondering if you can provide a query similar to the one below, but with the capacity to assign SDAdmin role to an specific user or to the Administrator user.  The situation is that a local customer reports that he remove SDAdmin role and now the Administrator does not have the Admin Tab when login to SDP.  I need to offer a solution in order that the customer be able to login with admin rights again.  I found the below query that may help if you can modify it to assign the SDAdmin role.  Thanks.


1. Execute this query to find all the Administrator logins in the application.

select al.login_id"Login ID",au.first_name"Name",al.name"Login Name" from aaaauthorizedrole aar left join aaarole ar on aar.role_id=ar.role_id left join aaaaccount aa on aar.account_id=aa.account_id left join aaalogin al on aa.login_id=al.login_id left join aaauser au on al.user_id=au.user_id left join sduser sd on au.user_id=sd.userid where aar.role_id=4 and sd.status='ACTIVE';

2. From the output of the first query, identify the right user and use the login_id for that user in the below query(where it is highlighted) to reset his password.
update AaaPassword set password='2+uYvE3SLfO3XaHl+CaGLA==', SALT='1103287238602' where password_id in (select ap.password_id from aaaaccpassword ap left join aaaaccount ac on ac.account_id=ap.account_id left join aaalogin al on al.login_id=ac.login_id where al.login_id= LOGIN_ID) ; 


                  New to ADSelfService Plus?