See below:
"update user cn attribute" <update user cn
> wrote in message
news:E9DC8304-4A86-4092-92B6-...
>I use java program ldap to accept active directory
> i have two question,please help me, thanks
>
> i want update user informatoin, if i don't update user name or cn
> attribute,
> it can run sucess. but when i want update name or cn attribute it error.
> the error is:
>
> javax.naming.OperationNotSupportedException: [LDAP: error code 53 -
> 00002016: Sv
> cErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0
>
> how can i update name and cn attribute in user
You cannot modify the cn attribute directly. Instead you must rename the
object. I've never seen a Java program for this, but in VBScript you bind to
the parent container/OU object and use the MoveHere method to rename
objects.
>
>
> the second question is:
> i want move user from an group to another group, forexample:
> i want update user dn:
> CN=test1,OU=AD111,OU=??,OU=??????,O=gdepb,DC=gdepb ,DC=gov,DC=cn
> to another group with dn update to
> dn:CN=test1,OU=AD222,OU=??,OU=??????,O=gdepb,DC=gd epb,DC=gov,DC=cn
>
> how i can move user from AD111 to AD222
What you describe are not groups but Organizational Units. You want to move
the objects from one OU to another. Again in VBScript you use the MoveHere
method of the OU where you want to object to reside (OU=AD222 in your
example).
Note, the "name" of any object is the Relative Distinguished Name (the name
of the object in its parent container/OU), which in the case of user objects
is the string "cn=" followed by the value of the cn attribute.
A VBScript program to rename user cn=Test1 to cn=NewName in OU=AD111 would
be:
Set objOU =
GetObject("LDAP://OU=AD111,OU=??,OU=??????,O=gdepb,DC=gdepb,DC=gov,D C=cn")
objOU.MoveHere
"LDAP://CN=test1,OU=AD111,OU=??,OU=??????,O=gdepb,DC=gdepb ,DC=gov,DC=cn",
"cn=NewName"
A VBScript program to move user cn=Test1 from OU=AD111 to OU=AD222 would be:
Set objOU =
GetObject("LDAP://OU=AD222,OU=??,OU=??????,O=gdepb,DC=gdepb,DC=gov,D C=cn")
objOU.MoveHere
"LDAP://CN=test1,OU=AD111,OU=??,OU=??????,O=gdepb,DC=gdepb ,DC=gov,DC=cn",
vbNullString
If the MoveHere method is available in Java, perhaps you can convert these
examples. Otherwise, perhaps someone else can help.
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--