I am trying to retrieve all the deleted users those are deleted from a particular OU. I am using the below query and it works fine.
string query = string.Format("(&(objectclass=user)(isdeleted=true)(lastknownparent={0}))", ouDn);
When "ouDn" is the value of any available OU, the above query works fine. When I set "ouDn" with a deleted OU distinguishedname(OU=xxxxxx\0ADEL:a82be8cf-1149-4f5b-b42d-fb6c72bceb24,CN=Deleted Objects,DC=xxxx,DC=xxx), I could not get any results but I have deleted users with that lastknownparent in my AD.
Please guide me to how to use deleted OU distinguishedname in the above ldap query.