How to UCS remove dead computer automatically?

Hi All,
With hundreds clients, some of them haven’t logged into domain for a long time. How can UCS detect and remove them automatically after a period of time?

Hey,

there are no provisions in UCS that do such maintenance automatically. However, you can easily script that yourself by walking over all existing computer accounts in the AD (e.g. by calling univention-s4search or connecting via LDAP) and checking their lastLogon and lastLogonTimestamp fields (see this article for the difference and how to chose which field to use; in short: use whichever value is bigger).

Both fields store the number of 100-nanoseconds since 1606-01-01 UTC. You can use the LDAP, Active Directory & Filetime Timestamp Converter for checking if your calculations are correct.

Kind regards
mosu

Mastodon