Deletes a child DirectoryEntry from this collection.
[Visual Basic] Public Sub Remove( _ ByVal entry As DirectoryEntry _ ) [C#] public void Remove( DirectoryEntry entry ); [C++] public: void Remove( DirectoryEntry* entry ); [JScript] public function Remove( entry : DirectoryEntry );
Exception Type | Condition |
---|---|
InvalidOperationException | The node you are trying to remove is not a child of the given DirectoryEntry. |
COMException | The given DirectoryEntry does not exist. The associated error code is E_ADS_OBJECT_UNKNOWN. |
The entry must be an empty container or a non-container. To delete an entry and all its children, use the DeleteTree method from DirectoryEntry.
DirectoryEntryCollection Class | DirectoryEntryCollection Members | System.DirectoryServices Namespace