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
Solved

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

Posted on 2010-09-09
5
1,523 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
  • 3
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
arober11 earned 125 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
The viewer will learn how to count occurrences of each item in an array.

856 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