WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Error 239 Attempting to Rename an Account

 Keywords:  

Question:

I want to use the ADSI extender to rename an account using the format "Lastname,Firstname". However I keep receiving the error 239.
; Set credentials
dsSetCredent("Me", "********")

; User account to be renamed.
pUser = "LDAP://MyServer/CN=Homer Simpson,CN=Users,DC=myDomain,DC=windowware,DC=com"
pTarget = "LDAP://MyServer/CN=Users,DC=myDomain,DC=windowware,DC=com"

; New account name
cnNewName = "CN=Rabbit,Roger"

; Now move. 
pNewPath = dsMoveObj(pUser, pTarget, cnNewName) 

message("New Path", pNewPath) 
exit
WWWBATCH.INI file indicates the last error 8329.

Answer:

The contents of the wwwbatch.ini indicates the error number 8329. This error number indicates:
ERROR_DS_NO_PARENT_OBJECT
The operation could not be performed because the object's parent is either uninstantiated or deleted.
Not real sure how this would apply to the error 239, your seeing.

-----------

Commas are used to delimit an LDAP path, so you will need to somehow 'escape' the comma character.

Check out the RFC (Request for Comments) #1779 http://www.ietf.org/rfc/rfc1779.txt?number=1779

This documents contains the proper string representation of Distinguished Names.

It explains 2 different methods for quoting of a comma in an Organisation name:

   CN=L. Eagle, O="Sue, Grabbit and Runn", C=GB

   CN=L. Eagle, O=Sue\, Grabbit and Runn, C=GB
I would guess the same applies for the Common Name. This means you will need to include a special set of quotes around the CN name or use the \ character to escape the comma character.

Try modifying your script to the following:

Change the line from:

cnNewName = "CN=Rabbit,Roger"
To:
cnNewName = 'CN="Rabbit,Roger"'
Notice the use of single and double quotes.

More:

Here is a link to RFC #2253 that explains how to deal with 'special characters used in the LDAP path. The list of 'escaped' characters for any component of an LDAP DN (not just CN) is defined in http://www.ietf.org/rfc/rfc2253.txt in section 2.4.

This document basically explains that there are, different ways of dealing with special characters (like the comma) in ADSI path.

Special characters are:

    
"," 
"=" 
"+"
"<"
">"
"#"
";"
If a character is one of the list shown above, then it should be escaped.

Article ID:   W15385
File Created: 2003:05:13:11:27:24
Last Updated: 2003:05:13:11:27:24