Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LDAP/PHP Password Reset (force change at next login)

Posted on 2010-09-09
5
Medium Priority
?
1,701 Views
Last Modified: 2013-12-24
I am trying to create a script where the user will type in the username and then the password will be reset to a default password eg "changeme" which when the user logs in will be asked to change that password.

I want it saved as a function and will pass the username and directory in which the user is stored in Active directory  eg

changepassword($username,$dir){
   //etc etc
}

Any thoughts?
0
Comment
Question by:alumwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
arober11 earned 375 total points
ID: 33638275
Not tried it but there are hundreds of php snippets out there that either Change an AD password or mark an AD password as expired, a few min's cutting and pasting should achieve what you want. Some code that sets a password to a constant and sets the PASSWORD_EXPIRED flag e.g.

http://www.letu.edu/people/markroedel/netcccu/activedirectorypasswordchanges.htm
http://snippets.dzone.com/posts/show/4059
http://forums.devshed.com/ldap-programming-76/modifying-active-directory-passwords-through-php-and-iis-74683.html
http://tracker.moodle.org/secure/attachment/11275/ad-pwd-expiration-18.diff
http://support.microsoft.com/default.aspx?scid=kb;en-us;305144
0
 
LVL 26

Expert Comment

by:arober11
ID: 33638591
0
 

Author Comment

by:alumwell
ID: 33650692
Thank you for the suggestions, However I cannot get them to work as I would like, A couple of those examples required the old password to function. I want to be able to type in a username (which is in the active directory) and then it will just reset the password to 'password' and would require the user to change their password upon logging in.

So any ideas on how to do this?
I have already done a search on this site for  passwords and LDAP and have not found what I am looking for.
0
 
LVL 26

Expert Comment

by:arober11
ID: 33756832
Yes, per my last post, the accepted solution, in POST http://www.experts-exchange.com/Q_23512181.html#21878543,  takes the user-id from a Text box, named: user_to_reset, log's into the Directory, then changes the Password to the contencts of variable: $userpassword and marks the password as expired.
0
 

Author Closing Comment

by:alumwell
ID: 33884296
 
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question