Hi Everyone,
Our environment has about 1500 "Active" systems but we have identified over 400+ "stale" systems in Active Directory where the Computer account has a pwdLastSet value > 90 days. I've already found AD scripts and tools for handling these entries in AD, but I would also like to build a Collection in SCCM based on pwdLastSet as well.
I've extended AD System Discovery to collect the pwdLastSet attribute from AD and have used CAST for SQL reports to convert the integer value to DATE format but am not sure how to do this in WQL?
My SQL Query is:
SELECT Name0, CAST((pwdLastSet0 / 864000000000.0 - 109207) AS DATETIME) AS [Password Last Set]
FROM v_R_System
WHERE CAST((pwdLastSet0 / 864000000000.0 - 109207) AS DATETIME) < GetDate() - 180
ORDER BY Name0
I've searched extensively to try and find how to do this in WQL but everything I find seems to be SQL or AD tool related rather than how to build a WQL query for this. Can anyone assist?
Thanks!
-Jeff