I got it to work on a local machine also now but I need to change users
within active directory.  I dug up an article on msdn that I need to use
ldap to connect.

I'm using a script that requests info from previous page but it fails on the
connection string.

CsConnectString = "LDAP://CN="; & sUser & ",OU=users, " & "DC=whathere?,
DC=andhere?"
Response.Write "Connect string: " & sConnectString & "<br>"

Set oUser = GetObject(sConnectString)


I found this on msdn's site but I'm stumped as to what to put in the DC
places.  I think I have the rest dissected but the DC part.  The example
showed the following:

CsConnectString = "LDAP://CN="; & sUser & ",OU=users, " & "DC=mycompany,
DC=Com"
Response.Write "Connect string: " & sConnectString & "<br>"

Set oUser = GetObject(sConnectString)

Should I replace the mycomputer with the exact computer name ex:
www.mydomain.com or just the prefix www.    The the last part has me
confused also what does DC=Com supposed to do.

I might be rattling on and missing the main picture but I am running out of
time very fast and I am at wits end!!





Thanks again
Jon

If it helps here is all the code:


<%@ Language=VBScript %>
<%

'CALLOUT A
dim sUser, sPassword
dim oUser, sConnectString
'END CALLOUT A

'CALLOUT B
sUser = request("txtUserName")
sPassword = request("txtPassword")
sNewPassword = request("txtNewPassword")
if sUser = "" then Response.Redirect "ChangePasswordEntry.asp"
'END CALLOUT B

Response.Write "User name is: " & sUser & "  --  " & sPassword & "<br>"

Response.Write "New Password is: " & sNewPassword & "<br>"

'CALLOUT] 
CsConnectString = "LDAP://CN="; & sUser & ",OU=users, " & "DC=mycomputer,
DC=Com"
Response.Write "Connect string: " & sConnectString & "<br>"

Set oUser = GetObject(sConnectString)
'END CALLOUT C

Response.Write "Logon user: " & Request.ServerVariables("LOGON_USER") &
"<br>"
Response.Write "User Password: " & Request.ServerVariables("AUTH_PASSWORD")
& "<br>"

'CALLOUT D
oUser.ChangePassword sPassword, sNewPassword
'END CALLOUT D

set oUser = Nothing

%>

 -----Original Message-----
From:   Nabil Al-Hage Ali [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, August 16, 2002 3:47 PM
To:     ActiveServerPages
Subject:        RE: active directory password change



<%
i used your code somehow and it works fine..
   
Call ChangeUser("test1","myServerName","test12" ," test1234")
response.write "Done"

Sub ChangeUser( strUser,strDomain,  strOldPassword, strNewPassword)
        
        Dim User
        Set User = GetObject("WinNT://" & strDomain & "/" & strUser &
",user")
        User.ChangePassword strOldPassword,strNewPassword
        User.Setinfo
        Set User = nothing
        
End Sub



%>

 
> Sorry here is the error I get:
> 
> error '80070056' 
> /test/adpass.asp, line 25 
> 
> 
>  -----Original Message-----
> From:         Jon Barnhardt [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, August 16, 2002 1:01 PM
> To:   ActiveServerPages
> Subject:      RE: active directory password change
> 
> I found a script that seems to do what I need but it errors on line 25
whats
> wrong?  Also does this script need to be on the actual box that active
> directory is on or another server that authenticates through it.
(Webserver
> authenticating through MDC box?)
> 
> Here is the code:
> 
> <%
> 
> Dim strUser, strDomain, strFullname, strDesc, strOldPassword,
strNewPassword
> 
> strUser = "mytestuser"
> strFullname = "MyFullname"
> strDesc = "MyDescription"
> strOldPassword = "passtest"
> strNewPassword = "MyNewPass"
> strDomain = "MyDomain"
> 
> 
>    ChangeUser
>
"mytestuser","MyDomain","MyFullname","MyDescription","MyOldPass","MyNewPass"
> 
>    Sub
>
ChangeUser(strUser,strDomain,strFullname,strDesc,strOldPassword,strNewPasswo
> rd)
>      Dim User
>      Set User = GetObject("WinNT://" & strDomain & "/" & strUser &
",user")
>      User.Fullname = strDesc
>      User.Description = strDesc
>      User.ChangePassword "newpass","passtest"    (Line 25)
>    User.Setinfo
>    Set User = nothing
>  End Sub
> %>
> 
> 
> Thanks for any and all help beings I've never worked with ADSI before!
> 
> 
> Jon
>  -----Original Message-----
> From:         Andrew Haslett [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, August 16, 2002 12:10 AM
> To:   ActiveServerPages
> Subject:      RE: active directory password change
> 
> definately possible and actually not that difficult to intercat with AD
> through the WEB.
> 
> Search for ADSI on MSDN and you'll find heaps of articles.
> 
> Cheers,
> Andrew
> 
> -----Original Message-----
> From: Jon Barnhardt [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 16 August 2002 9:01 AM
> To: ActiveServerPages
> Subject: active directory password change
> 
> 
> I was wondering if anyone has ever created a way to create new users via
the
> web in active directory services on a windows 2000 adv server box.  Any
> suggestions or sample code would be greatly appreciated.
> We actually have to enable the 2000 users to change their passwords via
the
> web.  We are caught in an unexpected upgrade in exchange server that has
to
> be completed by Monday and at that point 2000 email users will have their
> passwords reset to default.  We lack the manpower to change their
passwords
> by hand so we need a way to enable them to do it themselves via the web.
> Thanks for any and all advice.
> 
> Jon
> 
> ---
> You are currently subscribed to activeserverpages as:
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
> 
> 
> 
> ---
> You are currently subscribed to activeserverpages as:
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
> 
> ---
> You are currently subscribed to activeserverpages as:
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
> 
> ---
> You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to %%email.unsub%%



---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to