Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Can we fetch all user accounts and orphan accounts for a particular application using a single query

Kanchukuri
New Contributor II
New Contributor II

Hi Team,

Can we fetch all user accounts and orphan accounts for a particular application using a single query. If so, please provide. thanks in advance.

regards,

mahesh

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

Orphan Accounts

SELECT a.name 'Account Name', e.displayname 'Application Name', CASE WHEN a.status = 1 THEN 'Active' ELSE a.status END AS 'AccountStatus', e.endpointKey, a.accountclass, a.ACCOUNTTYPE FROM accounts a INNER JOIN endpoints e ON a.endpointKey = e.endpointKey AND a.status IN (1 , 'Active', 'Manually Provisioned') LEFT JOIN user_accounts ua ON ua.accountkey = a.accountkey WHERE ua.USERKEY IS NULL;

 

User Accounts 

SELECT a.name 'Account Name', e.displayname 'Application Name', CASE WHEN a.status = 1 THEN 'Active' ELSE a.status END AS 'AccountStatus', e.endpointKey, a.accountclass, a.ACCOUNTTYPE FROM accounts a INNER JOIN endpoints e ON a.endpointKey = e.endpointKey AND a.status IN (1 , 'Active', 'Manually Provisioned') LEFT JOIN user_accounts ua ON ua.accountkey = a.accountkey WHERE ua.USERKEY IS NOT NULL;


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

dgandhi
All-Star
All-Star

Can you try this?

dgandhi_1-1714146476188.png

If Username is null then its orphan and not associated with any identity.

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Kanchukuri
New Contributor II
New Contributor II

Hi Gandhi,

Thanks for the above query and it is working fine. please also share the query if we want to extract entitlement values for both user & orphan accounts

regards,

mahesh

Refer https://forums.saviynt.com/t5/identity-governance/analytics-query-to-fetch-accounts-under-a-particul...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.