Jump to content

acraiger

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by acraiger

  1. For the Select Case PwdType on reset_pass.asp I added an If statement: I changed it from: Case 5 If (Not ISEmpty(Request.Form("NewPass"))) Then NewPassword = Request.Form("NewPass") 'check for blank password ResetPass() Else PWPromptUser() End If To: Case 5 If (Not ISEmpty(Request.Form("NewPass"))) Then NewPassword = Request.Form("NewPass") 'check for blank password If NewPassword = "" Then PWPromptUser() Else ResetPass() End If Else PWPromptUser() End If It's probably not the cleanest way to do this, but it seems to be working. I wish I knew how to program in ASP a little better, then I could create better fixes.
  2. If you could upload the code as to how you did this, that would be great. I've gotten a new boss, and he decided he wants this implemented this. I just discovered that a user can set their password to blank, which is not good. It does seems to error out for any other password that does not meet our Domain password complexity. If I figure out a solution, I'll upload my code change.
  3. Well, I got this program to work using LDAP for accessing Active Directory to change the password. The main reason for me doing this was so the user account I use for these operations did not have to be a Domain Admin. I can now just use a regular Domain User account, and just delegate the needed permissions via the OU that holds the user accounts, that you want to be able to reset with this tool. The persmissions I assigned to the user account for resetting passwords at the OU level: Change Password Reset Password Read/Write Account Restrictions Read pwdLastSet Write pwdLastSet Read lockoutTime Write lockoutTime I'm not sure if you need all these permissions, but these are the permissions that were used by similar commercial products I tested. I made quite a few additions to the resetpass fuction in the reset_pass.asp and adminreset.asp, and have attached the files with the additions I made. I also commented out some of the commands as they did not seem to be working with the LDAP commands. Below is the Code added at the beginning of the resetpass function. You have to enter your NetBiosName, but maybe this can be added to the config file which holds the other Global variables. ' Specify the NetBIOS name of the domain and the NT name of the user, Change NetBiosName to your NetBiosName. strNTName = "NetBiosName" & "\" & strusername ' Use the NameTranslate object to convert the NT user name to the ' Distinguished Name required for the LDAP provider. Set objTrans = CreateObject("NameTranslate") ' Initialize NameTranslate by locating the Global Catalog. objTrans.Init ADS_NAME_INITTYPE_GC, "" ' Use the Set method to specify the NT format of the object name. objTrans.Set ADS_NAME_TYPE_NT4, strNTName ' Use the Get method to retrieve the RPC 1779 Distinguished Name. strUserDN = objTrans.Get(ADS_NAME_TYPE_1779) 'END OF CODE FOR LDAP to replace Getobject("WinNt: Then I commented out: 'Set objUser = GetObject("WinNT://" & FQDN & "/" & strusername & ",user") and replaced with: Set objUser = GetObject("LDAP://" & strUserDN) The force password reset no longer worked, so I replaced this command with: objUser.Put "PwdLastSet", 0 The code probably needs a little cleaned up, as I did not remove any code, but instead just commented it out. I thinking I'm just ready to roll this out on our production network. ResetPass.zip
  4. I think I've gotten everything working on an IIS Server that is not a Domain Controller. reset_pass.asp In the function ResetPass, I added the line Err.Clear, to clear the Err value at beginning of the function. This clears any errors codes that Err might have been set to before running this function. The extra command is highlighted below: Function ResetPass 'Begin Password Reset Code Dim usr, oUser, oFlags 'Clear the Err holder Err.Clear 'Connect to Active Directory, reset and expire password Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") objLogon.Logon ImpersonateUser, ImpersonateUserPass, FQDN Set oUser = GetObject("WinNT://" & FQDN & "/" & strusername & ",user") If Err.number <> 0 Then PageContent(0) = "Error: Unable to bind to container" Else oFlags = oUser.Get("UserFlags") . . I also updated my Adminreset.asp. Somebody else had mentioned the quotes for ("Newpassword") on page 10 of this forum, for which. It looks like it never got fixed on the downloadable version. I checked the svn version, and it has not been updated either. It's line 213 of Adminreset.asp. I'm going to do a little more testing on my Lab environment before going Live on our Corporate environment. Anyways, I think this is an awsome project, and should cut down on the Helpdesk calls on Monday morning.
  5. I commented out the error check where the code is highligted on reset_pass.asp: Also commented out the Endif at bottom of coded If statement. 'Connect to Active Directory, reset and expire password Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser") objLogon.Logon ImpersonateUser, ImpersonateUserPass, FQDN Set oUser = GetObject("WinNT://" & FQDN & "/" & strusername & ",user") 'If Err.number <> 0 Then ' PageContent(0) = "Error: Unable to bind to container" 'Else . . . Set rsRegisterUser = Nothing Set adoCon = Nothing End If 'End If And was able to do a password reset on a non-domain controller IIS server. So maybe it is just a problem with the error code checking. I was looking at the code all day, and I could not find anything wrong with the code. I'll work on this more tomorrow, as it is time for me to get off work.
  6. I just installed on a DC, and it does work. I tried it on a XP PC, as akshdesh seemed to have gotten it to work, but this gives the exact same error. It just does not want to work on a stand alone IIS Server. So I'm wondering if I just entered something incorrectly. Here is my settings for the cred.ini file: [Main] ImpersonateUser=sspr ImpersonateUserPass=Password1 [End] On a DC, does the cred.ini file not get used?
  7. I've been looking a self password reset program, and just happened upon this thread. The program looks really nice, if I could get it to work. I've installed the program on an IIS server, and followed the instructions as best I could. But I am unabled to reset a password. I get: Resetting password for exec1 ... An unexpected error occurred in the execution of this page Please report the following information to an Administrator Page Error Object Error Number: 450 Error Description: Wrong number of arguments or invalid property assignment Source: Microsoft VBScript runtime error LineNumber: 0 Allowed Attributes: This is when using the Admin page. When using the reset page I get: Error: Unable to bind to container Also, I've read about an instruction video, but cannot find where it is located. Is there a pdf with screen shot instructions somewhere? Any help would be greatly appreciated. Thanks, Craig
×
×
  • Create New...