dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Jan 8, 2001

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Use Recursion to Simplify Object Deletion Using ADSI and VBScript


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(
John Lathrop
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date