03/28/2023 11:18 AM
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;
03/28/2023 11:46 AM
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
03/28/2023 07:58 PM
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.
04/03/2023 03:56 PM
You can go to Admin --> Identity Repository --> Accounts --> Actions --> Upload Accounts
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
Then click on Upload and Preview which will take you to the next screen
Click on Import Now and you can use the parameter user account mapping updated as below
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;
04/03/2023 03:57 PM