We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Update Userkey (CUSTOMQUERYJOB)

Puspanjali
New Contributor
New Contributor

Hi Team,

I'm trying to replace the account's userkey with Account's owner

I'm using the below query with CUSTOMQUERYJOB

But the job is throwing an error

If the team could help me to fix this query.

 

UPDATE ua
SET ua.USERKEY = ao.OWNERUSERKEY
from user_accounts ua INNER JOIN accountowners ao ON ua.ACCOUNTKEY = ao.ACCOUNTKEY
INNER JOIN accounts a ON a.ACCOUNTKEY = ua.ACCOUNTKEY
where a.ENDPOINTKEY = 104 AND ua.USERKEY != ao.OWNERUSERKEY AND ua.ACCOUNTKEY = 18364648;

 

4 REPLIES 4

Hemanath
Saviynt Employee
Saviynt Employee

Hi @Puspanjali ,

can you please explain what you are trying to achieve, do you want to update only one user or entire users 

Thanks,

Hemanath J

Hi Hemanath

I wanted to replace the username value of all service accounts with their owner value

Issue: After the owner has terminated of service account, with the help of  rule Saviynt  is auto-transferring that service account to the secondary manager of the owner but it's not changing the username of that service account to the secondary manager

So I thought of using the custom job to replace it.

 

SVC.png

SVCowner.png

ParitaSavla
Saviynt Employee
Saviynt Employee

You can go to Admin --> Identity Repository --> Accounts --> Actions --> Upload Accounts

ParitaSavla_0-1680561669305.png

Create a csv file as per the attachment and during the upload select the override user assigned as yes to change the username mapped to the account as well as select the security system

ParitaSavla_1-1680561898953.png

Then click on Upload and Preview which will take you to the next screen

ParitaSavla_2-1680561984345.png

Click on Import Now and you can use the parameter user account mapping updated as below

ParitaSavla_3-1680562156273.png

This will allow you to bulk update user to account corelation.

Also, to get the data that needs to be part of the csv you can use a query as below

select ao.owneruserkey as 'Username', a.name as 'account name', a.endpointname as 'Endpoint' user_accounts ua, accounts_owners ao, accounts a,endpoints e where ua.ACCOUNTKEY = ao.ACCOUNTKEY and a.ACCOUNTKEY = ua.ACCOUNTKEY and a.ENDPOINTKEY = 104 AND ua.USERKEY != ao.OWNERUSERKEY and e.endpointkey = a.endpointkey and ua.ACCOUNTKEY = 18364648;

 

 

ParitaSavla
Saviynt Employee
Saviynt Employee

Forgot to attach the sample csv file in the previous response