Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Help to solve reset User LDAP problem

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi members,
I 've wrote a java class to change user password by LDAP, I used code in this forum for reference, but when running, It created an error. Please help me to solve this.
Thanks a lot.
These errors are here:
So ngau nhien: 54g0o7i5
>>>1CN=Nguyen Thi Thu Huong,OU=KTTH,OU=C5
Test: [;@ca2dce
Sr: CN=Nguyen Thi Thu Huong,OU=KTTH,OU=C5: null:null:{objectcategory=objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=vms,DC=com,DC=vn, userparameters=userParameters: m: d , whencreated=whenCreated: 20080915103229.0Z, badpwdcount=badPwdCount: 0, mdbusedefaults=mDBUseDefaults: TRUE, codepage=codePage: 0, mail=mail:, objectguid=objectGUID: ?s/??M?-??, msexchuseraccountcontrol=msExchUserAccountControl: 0, msexchmailboxsecuritydescriptor=msExchMailboxSecurityDescriptor: 
Problem resetting password: javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001CD, problem 2001 (NO_OBJECT), data 0, best match of:
'DC=vms,DC=com,DC=vn'... remaining name 'cn=LDAP://,DC=com,DC=vnhuongntt'

Here is my code
Posts: 3742
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to print out the distinguished name of the user you are trying to modify.
before the ctx.modifyAttributes line and check that it is correct. The error is saying the user can't be found.

I don't want to discourage you too much, but using LDAP to change the password of an Active Directory user is a real pain. Good luck.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic