Search generating exception [Active Directory Recycle Bin] [DirectoryEntry]
I'm trying to retrieve information about deleted objects in Active Directory. Typically, these objects are stored in the Active Directory recycle bin. I can perform searches using the DirectorySearcher class, but when I attempt to query the DirectoryEntry class using the same path from DirectorySearcher, I encounter exceptions for all fields.
String myADSPath = "LDAP://IP_SERVER/CN=HOSTNAME\0ADEL:GUID,CN=Deleted Objects,DC=adomain,DC=br";
DirectoryEntry myDirectoryEntry = new DirectoryEntry(myADSPath, username, password);
String test = myDirectoryEntry.Parent.Path;
I can run the same query without any issues when it involves an active object. However, I'm encountering problems specifically with deleted objects. I would like to know if there are any alternative methods to investigate this issue. It's possible that there are permissions I might not have.