Changing ADAM user password



I've got an existing ADAM user. I'm trying to change its password in
c#. I know the current password is set correctly because I can bind to
the instance via LDP with its credentials. Here is how I am trying to
change the password:

string ldapPath = "LDAP://CN=My User,OU=My
Unit,DC=MYPARTITION,DC=ADAM";

string userID = "myUser"; // this is the userPrinicpalName for my
user's ADAM entry

DirectoryEntry changeEntry = new DirectoryEntry(fullDN, userID,
oldPassword, AuthenticationTypes.None);

if (changeEntry != null)
{
// ** code fails on next line
changeEntry.Options.PasswordEncoding =
PasswordEncodingMethod.PasswordEncodingClear;

changeEntry.Options.PasswordPort = 9389;

changeEntry.Invoke("ChangePassword", new Object[] {oldPassword,
newPassword });
}

At the code marked "**" above, I get an exception "no such object on
the server".

Now this usually means one of two things:

1. The object really does not exist - It does in my case
2. There is a security issue accessing the entry

So #2 sounds more likely, but I'm providing the user's current
userPrincipalName and password to bind to the entry. Do I have to add
all my ADAM users to the "Readers" role just to allow them to change
passwords on their own object?

Mike

.



Relevant Pages

  • Re: ADAM bind using ADSI EDIT
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... I enter the full DN of the ADAM user I'm trying to bind as. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Accessing LDAP to connect to ADAM instance
    ... What user are you trying to bind as? ... Is this a Windows user or an ADAM user? ... If this is an ADAM user, then you MUST use simple LDAP bind, and full ADAM ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADAM bind using ADSI EDIT
    ... Co-author of "The .NET Developer's Guide to Directory Services ... I enter the full DN of the ADAM user I'm trying to bind as. ... Why can I bind using LDP but not using ADSI EDIT? ...
    (microsoft.public.windows.server.active_directory)
  • Re: Unable to bind with new ADAM accounts
    ... the UPN for the ADAM user IF you set it ... Make sure you uncheck the "domain" box so that secure authentication ... >> If the account is a native ADAM user then a likely cause is that the ... >> You do not say how you are attempting to bind, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Newbie Bind DNS help needed!
    ... > I need to add an entry for a local machine 192.168.0.180, ... I don't know webmin but unless you have a daemon already setup setting ... the database for a bind daemon isn't just editing a file. ...
    (comp.os.linux.networking)