Advertisement

10.26.2007 at 03:27PM PDT, ID: 22921387
[x]
Attachment Details

DirectoryEntry.Invoke("SetPassword", .... The directory property cannot be found in the cache

Asked by one1082 in Active Server Pages (ASP), C# Programming Language, Lightweight Directory Access Protocol (LDAP)

Tags: , , , ,

Hello,
  I'm having trouble changing a user's password in LDAP using ASP .Net 2.0 / C#.

The LDAP server is: OpenLDAP on Red Hat 4EL.


The code is as follows:

de = new DirectoryEntry(ldapPath, ldapUsername, ldapPassword);
de.AuthenticationType = AuthenticationTypes.ServerBind;

DirectorySearcher srch = new DirectorySearcher(de);
srch.Filter = "(CN=user.name)";

SearchResult result = srch.FindOne();

if (result != null)
{
     // User found, try to reset their password
     try
     {
          DirectoryEntry user = result.GetDirectoryEntry();
          user.Invoke("setPassword", new object[] { newPassword });
          de.CommitChanges();
     }
.
.
.

The error occurs at this line:
          user.Invoke("setPassword", new object[] { newPassword });

and returns these exceptions:
          Exception.Message = Exception has been thrown by the target of an invocation.
          Exception.InnerException.Message = The directory property cannot be found in the cache.

Thank you in advance for your help!

TimStart Free Trial
[+][-]10.26.2007 at 05:19PM PDT, ID: 20159915

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.27.2007 at 11:17AM PDT, ID: 20162355

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.27.2007 at 03:58PM PDT, ID: 20163138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 09:42AM PDT, ID: 20170981

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 12:35PM PDT, ID: 20172558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.29.2007 at 12:43PM PDT, ID: 20172633

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.30.2007 at 06:37AM PST, ID: 20550893

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), C# Programming Language, Lightweight Directory Access Protocol (LDAP)
Tags: property, cannot, directory, found, cache
Sign Up Now!
Solution Provided By: viperman1271
Participating Experts: 3
Solution Grade: A
 
 
[+][-]03.12.2008 at 07:47PM PDT, ID: 21112917

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628