Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help
in Search

What is the most efficient way to determine if an ADAM object exists? (.NET v1.1)

Last post 06-24-2008, 5:54 PM by joe. 1 replies.
Sort Posts: Previous Next
  •  06-24-2008, 1:29 PM 4024

    What is the most efficient way to determine if an ADAM object exists? (.NET v1.1)

    What is the most efficient way to determine if an object exists? I have found many posts saying that DirectoryEntry.Exists is unreliable and does not support passing credentials.

    I used to check if e.NativeObject == null and an exception would be thrown if the object didn't exist, however, now I'm trying to switch to FastBind and the exception is no longer thrown.


  •  06-24-2008, 5:54 PM 4026 in reply to 4024

    Re: What is the most efficient way to determine if an ADAM object exists? (.NET v1.1)

    If you want to move the least data across the network as possible and want to use the DirectoryEntry for this, then a RefreshCache operation on a single small attribute is likely the best bet.  Using the DirectorySearcher is also probably as fast, especially if you have already established a connection.

    I do generally recommend avoiding the Exists method for the reasons you already stated.

View as RSS news feed in XML