and more in a single search tool across platforms. Read the announcement here. |
04/12/2022 12:57 PM
Hello,
I have been trying to create an analytical report which will shows me which AD user accounts have been disabled in the last 30 days. So the account would have gone from Active (1) to Inactive (2) in that time frame.
I have been fudging around, and I think the below shows what accounts have been disabled in the last 30 days but only if the account was created in the last 30 days? Our AD endpoint for AD is 1. I think I also need to change the endpoint key below somewhere to 1?
Thanks if you can help at all.
SELECT DISTINCT a.name 'Account Name', e.displayname 'Application Name', a.CREATED_ON 'Account Created', a.lastlogondate 'Last Logon', CASE WHEN a.status = 2 THEN 'Inactive' ELSE a.status END AS 'Account Status' FROM accounts a, endpoints e, securitysystems s WHERE a.endpointkey = e.endpointkey AND e.securitysystemkey = s.systemkey AND a.status IN (2 , 'Active', 'Manually Provisioned') and a.accountkey in (SELECT accountkey FROM user_accounts ua) AND DATEDIFF(CURDATE(), CREATED_ON) <= 30 ORDER BY s.systemname;
Solved! Go to Solution.
04/12/2022 02:00 PM
Hi David,
Please try to use updatedate instead of created_on to check the disabled accounts in last 30 days.
DATEDIFF(CURDATE(), a.updatedate)
Also, here's the Saviynt schema documentation for details on the tables and columns for your reference
https://saviynt.freshdesk.com/a/solutions/articles/43000521404
04/12/2022 02:00 PM
Thank you very much.