Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Advanced Query identifying users without AD account - Technical Rule - Detective

ram81
New Contributor III
New Contributor III

I need to create a detective rule that identifies users without a specific endpoint. I am using the query below but it seems to return all users. I would like to only identify users without a specific endpoint. 

---------------------------------------

a.statuskey=1 and a.id in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname NOT LIKE 'EndPointName')

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

a.statuskey=1 and a.id not in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname NOT LIKE 'EndPointName')

 
  •  

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thanks but this is the same query I provided. 

i have changed not in 

a.statuskey=1 and a.id not in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname NOT LIKE 'EndPointName')

 

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thanks, But this change did not return any results. 

I have validated and it works 

rushikeshvartak_0-1711594743786.png

a.statuskey=1 and a.id in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname ='Costar')


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Validation

rushikeshvartak_1-1711595411956.pngrushikeshvartak_2-1711595420267.png

rushikeshvartak_3-1711595453461.png

 

a.statuskey=1 and a.id not in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname = 'Costar')


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thanks!

Updated the syntax below and this worked. 

a.statuskey=1 and a.id not in (select distinct us.userkey from User_accounts us, Accounts cc, Endpoints ep where us.accountkey=cc.id and cc.endpointkey =ep.id and ep.endpointname LIKE 'EndPointName')