Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP Property for User-Password

Status
Not open for further replies.

NemesisCro

Programmer
Mar 20, 2007
2
CH
hi @ll,

I'm programming an application for AD-administrators, so that they can edit, create, etc. users in the webbrowser. I'm now at the point of giving the user a new password. My problem is, that I can't find (if it even exists) the LDAP-property for the user's password (like givenName, sAMAccountname, etc.).

Anyone knows how I can do this? I would be very happy if you could help me...


ps: sorry for my bad english, I'm from Switzerland, so...


greets
 
There is no field for password. The only way to do this would be to invoke a native function to set the password.

What programming language do you want to write this in? Also, is this so a user can change it themselves or so an admin can do it for them.

If you can answer those, I may be able to help you.
 
That is what I had in mind, but we need to know if nemesiscro wants to use vbscript, asp.net, c#, or whatever to do this. It is easily possible with all of them.
 
hi guys,

I'm programming in VB.Net.

Only the admin can change the password, nobody else.


greets
 
Ok, well here is some simple vbscript that will work. This code requires you to bind to the user object, so you will need the distinguishedName of the object in order to bind. If your program will already have the DN, then this is simple. If it does NOT have the DN then it is fairly easy to get the DN if you have a username or some other field to identify a user. I will assume for this that you already have the DN for the user. If not, let me know and I can help you get the DN easily as long as you have some data from the user to feed in.


Code:
Set objUser =_ GetObject("LDAP://cn=SomeUser,ou=OU1,dc=domain,dc=local")  
      objUser.SetPassword "NewPassword"
      objUser.SetInfo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top