An object in a Netscape Directory Server can only be deleted if it is a terminal node. This restriction causes the writing of source code to delete an object and all of the object’s children in the directory to be very complex. However, recursion can greatly simplify this operation.In the VBScript below, the code makes recursive calls to itself if the current object, oBj, has children. Eventually, recursion stops when a terminal node is reached and this node is deleted. As the process traces back up the stack through all of the recursions, each node is deleted until the starting node, sADsPathParent, is reached.
'********************************************************'Purpose: CAUTION - Deletes the object and all child objects!!!!''Language: VBScript'********************************************************Sub RecurLDAPDelete(sADsPathParent) Dim oTarget Dim oBj Dim oBjParent Dim oKid dim strADMIN_DN dim strADMIN_PW strADMIN_DN = Application(