Microsoft Knowledge Base Article - Q260251: This step-by-step article describes how to use Active Directory Services Interface (ADSI) to create, change, and remove Lightweight Directory Access Protocol (LDAP) directory attribute values.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q260251&
An excerpt from the article: “...if an attribute is modified to have no value (or values), the entire attribute is removed. At times you may want to set an attribute to null. While thisconcept does not exist in directories that support LDAP, you can accomplish this by removing the attribute entirely and specifying that the property is to be cleared. This behavior is consistent with the LDAP specification. Queries of the attribute value must expect the absence of the attribute itself and handle any error that may arise.”
Some attributes, however, are mandatory, and cannot be cleared. The system sets these mandatory attributes, except for one, sAMAccountName, which specifies the name that represents the user to NT clients and servers that are lower in the Win2K hierarchy. You must set the sAMAccountName attribute before you call IADs::SetInfo. This article discusses those as well as other methods for manipulating account information using ADSI.
http://www.winscriptingsolutions.com/Articles/Index.cfm?ArticleID=5456
The preceding is one chapter from an excellent series of 12 articles on ADSI. All 12 articles may be accessed from the following link:
http://www.iisfaq.com/default.asp?View=A343&Print=1
An excerpt from Chapter 6 of the article: “The next two sections attempt to enable and unlock the user account, respectively. However, the script doesn't quit if an attempt fails. The Err::Clear method, which works only if you enable On Error Resume Next, clears the error object so that you can detect the next error.”
REMOVE SPACES from the pasted URLs.