Thanks Clement. It looks close to what I want to achieve. Up to destMemberDn
all correct. Just I am doing mistake in putting code which you suggested at the
right place.
I am getting below logs:
destDn is
[CN=Hardik Shah,CN=Users]
destMemberDn is
CN=Hardik Shah,CN=Users,dc=testrjil,dc=net
resTab is
[Ljava.lang.String;@12d9a936
And code is as below:
var destMemberDn = destDn.get(0) + "," + ldap.getContextDn();
java.lang.System.out.println("destMemberDn is");
java.lang.System.out.println(destMemberDn);
var resTab =
java.lang.reflect.Array.newInstance(java.lang.String,destMemberDn.length);
for (var j=0; j< destMemberDn.length; j++) {
resTab[j] = destMemberDn[j];
}
java.lang.System.out.println("resTab is");
java.lang.System.out.println(resTab);
}
resTab
]]>
Not getting where I am doing mistake. Your help will be highly appreciated.
-Hardik
-----Original Message-----
From: Clément OUDOT [mailto:[email protected]]
Sent: 30 January 2015 15:06
To: Hardik V Shah
Cc: lsc-userslsc-users
Subject: Re: [lsc-users] user add/remove to group in AD
2015-01-30 10:24 GMT+01:00 <[email protected]>:
> Sure Clement. I have tried ldap search on AD and it returns below error while
> looking for member's DN.
>
> Jan 30 14:52:21 - ERROR - Error while adding entry
> cn=demogrp2,dc=testrjil,dc=net in directory
> :javax.naming.OperationNotSupportedException: [LDAP: error code 53 -
> 0000054F: SvcErr: DSID-031A120C, problem 5003 (WILL_NOT_PERFORM), data 0 ];
> remaining name 'cn=demogrp2'
> Jan 30 14:52:21 - ERROR - Error while synchronizing ID
> cn=demogrp2,dc=testrjil,dc=net: java.lang.Exception: Technical problem
> while applying modifications to the destination # Fri Jan 30 14:52:21
> IST 2015
> dn: cn=demogrp2,dc=testrjil,dc=net
> changetype: add
> member: sun.org.mozilla.javascript.NativeArray@46fd007c
> cn: demogrp2
> sAMAccountName: demotestgrp2
> objectClass: group
> objectClass: top
>
>
The error is not while looking for member's DN but when creating the entry.
Indeed the member value is misinterpreted by LSC.
> the code which I have tried is
>
> var destDn = ldap.search("CN=Users", "(sAMAccountName=" + uid + ")");
>
> uid I have passed is having correct value. Any idea?
>
Seems good.
The problem is the nature of the array that returns all members. Try maybe to
force the use of a java Array, like :
var resTab =
java.lang.reflect.Array.newInstance(java.lang.String,
memberIdValues.length);
for (var j=0; j< memberIdValues.length; j++) {
resTab[j] = memberIdValues[j];
}
resTab
Clément.
"Confidentiality Warning: This message and any attachments are intended only
for the use of the intended recipient(s).
are confidential and may be privileged. If you are not the intended recipient.
you are hereby notified that any
review. re-transmission. conversion to hard copy. copying. circulation or other
use of this message and any attachments is
strictly prohibited. If you are not the intended recipient. please notify the
sender immediately by return email.
and delete this message and any attachments from your system.
Virus Warning: Although the company has taken reasonable precautions to ensure
no viruses are present in this email.
The company cannot accept responsibility for any loss or damage arising from
the use of this email or attachment."
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users