The normal way to query a directory for users is (&(objectClass=user)(objectCategory=person))
. The normal way to query for deleted objects is to add (isDeleted=TRUE)
.
However, the objectCategory
attribute does not exist on tombstone objects, so a query for (&(objectClass=user)(objectCategory=person)(isDeleted=TRUE))
will get you nothing.
If you remove the (objectCategory=person)
part, you'll get computers too, as they inherit from user.
Is it possible to retrieve only deleted users?
If not, is it possible to tell from the returned tombstone object if it's a user or not?
Try an LDAP filter like:
This should retrieve most deleted user type entries.
python3 code