Contrary to the documentation the System.DirectoryServices.DirectoryEntry.Exists() method throws a COMException when presented with a path to a non-existent object using the WinNT provider (e.g. “WinNT://MyComputer/NoSuchUser,user”). The COMException complains about the target object not being found (e.g. “The user name could not be found.”).As the point of the Exists() method is to test for the existence of an object without the need to catch an Exception, the code is clearly buggy.
Version
Please wait...