You have to connect via. SSL or TLS to change a pw in AD. The error you're 
getting is because you are refencing an unset variable:

dn="#adresult.dn#"

Where did adresult come from?

Dave Ross
http://www.coldspringframework.org

>Hi
>
>Does anybody have any examples of using Coldfusion to reset a windows
>users active directory account.
>
>Can it be done using Coldfusion ?
>
>The way I envisage this is an employee completes an online form entering
>their active directory login ID and memorable data, and if correct they
>can set another password for their account.
>
>This is what I  have so far but how can I change it to allow the user to
>change their password, because at present there seems to be no data in
>the password field  ? And I am getting the error 'Element DN is
>undefined in ADRESULT. ' 
>
>Any ideas ?
>
>Thanks
>
>------------ login page snippet ----------
>
><cfform method="POST" action="processing.cfm" name="Form"> 
>
>Windows Logon : <cfinput type="text" name="sAMAccountName" size=22 ><br>
>First Name : <cfinput type="text" name="givenName" size=22 ><br>
>Surname : <cfinput type="text" name="sn" size=22 ><br>
>E-Mail : <cfinput type="text" name="mail" size=22 ><br>
>
><input type="image" src="search.gif" border="0" style="cursor:hand"
>width="49" height="18"> 
></cfform>
>
>------ processing.cfm page snippet -----------
>
><cfset StartOU="dc=domain, dc=co,dc=uk">
><cfset filter = "(&(objectClass=user)">
><cfif len(trim(Form.givenName))>
>  <cfset filter = filter & "(givenName=*#Form.givenName#*)"> </cfif>
><cfif len(trim(Form.mail))>
>  <cfset filter = filter & "(mail=*#Form.mail#*)"> </cfif>
><cfif len(trim(Form.sn))>
>  <cfset filter = filter & "(sn=*#Form.sn#*)"> </cfif>
>  <cfif len(trim(Form.sAMAccountName))>
>  <cfset filter = filter & "(sAMAccountName=*#Form.sAMAccountName#*)">
></cfif>
>
><cfset filter = filter & ")"> 
>
><cfldap action="query"
>name="adresult"
>attributes = "sAMAccountName,dn, cn,sn,givenName,password, mail,ou"
>start="#StartOU#"
>scope="subtree"
>filter="#filter#"
>server="servername"
>port="port"
>username="username"
>password="password"
>>
>
><cfoutput query="adresult">
>
>Hello #cn# 
><br>
><cfform method="POST" action="changepassword.cfm" name="search"> 
><p>Enter New Password<cfinput type="text"  name="password"></p>
><p>Confirm New Password<cfinput type="text"  name="password1"></p>
><input type="image" src="submit.gif" border="0" style="cursor:hand"
>align="right" width="49" height="18">
></cfform>
>
></cfoutput>
>
>---------------changepassword.cfm page snippet------
>
><cfldap
>action="modify"
>modifyType="replace"
>attributes="password=#password1#"
>dn="#adresult.dn#"
>server="server"
>port="port"
>username="username"
>password="password">
>
><p>Your Password has been changed</p>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268421
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to