I will post the code however, be warned of my inexperience with ASP ( I know
that I am in-correctly using the session object for instance)
<HTML>
<TITLE>Domain Password Tool</TITLE>
<HEAD>
</HEAD>
<BODY>
<H1>Domain Password Reset Tool</H1>
<HR>
<%
Dim objOU, objUser, objAD, objADO, objCmd, objRS, strDept
Set objADO = Server.CreateObject("ADODB.Connection")
objADO.Open "Provider=ADsDSOObject;"
Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = objADO
Session("department") = Request.QueryString("department")
Session("user") = Request.QueryString("user")
'On first page load display radio buttons for departments
If Session("department")= "" Then
Response.Write "<P><B>Choose a Department to see a list of users:</B></P>"
objCmd.CommandText = _
"<LDAP://dc=my,dc=domain,dc=com>;(objectClass=organizationa lUnit);name;subtr
ee"
Set objRS = objCmd.Execute
objRS.MoveFirst
Response.Write "<FORM method='GET' action='ASP_TEST.ASP'>"
Do Until objRS.EOF
Stop
If objRS.Fields("Name") = Null Then
strDept = ""
Else
strDept = objRS.Fields("Name")
End If
Select Case strDept
Case "_System"
Case "Domain Controllers"
Case Else Response.Write "<input type='radio' name ='department' " & _
"value='" & strDept & "'>" & strDept & "<BR>"
End Select
objRS.MoveNext
Loop
'Response.Write "<BR><INPUT type='Submit' value='Get Users'
name='department'>"
'If a
Else If Session("user") = "" Then
'Do User Lookups Here'
Dim strLDAP,intUAC
Const ADS_UF_ACCOUNTDISABLE = 2
strDept = Request.QueryString("department")
strLDAP = "LDAP://ou=" & strDept & ",dc=my,dc=domain"
Set objOU = GetObject(strLDAP)
objOU.Filter = Array("user")
Response.Write "<B>Choose User to change password for: </B><BR>"
Response.Write "<FORM method='GET' action='ASP_TEST.ASP'>"
For Each objUser In objOU
intUAC = objUser.Get("userAccountControl")
If intUAC AND ADS_UF_ACCOUNTDISABLE Then
Response.Write "<font color='red'>***Account: <B>" & _
objUser.DisplayName & "</B> Disabled - Contact Network Administrator to
re-enable</font><BR>"
Else
Response.Write "<input type='radio' name='user' " & _
"value='" & objUser.Name & "'>" & objUser.DisplayName & "<BR>"
End If
Next
Response.Write "<BR><INPUT Type='HIDDEN' name='department' value='" & _
strDept & "'>"
'Respons.Write "<INPUT type='Submit'>"
Else
Dim strUser
strUser = Request.QueryString("user")
Response.Write "<FORM method='GET' action='ASP_TEST.ASP'>"
Response.Write "Type New password here:<INPUT TYPE='Password'><BR>"
'Response.Write "Confirm: <INPUT TYPE='Password'><BR>"
Response.Write "<BR><INPUT Type='HIDDEN' name='department' value='" & _
Session("department") & "'>"
Response.Write "<BR><INPUT Type='HIDDEN' name='user' value='" & _
Session("user") & "'>"
End If
End If
Response.Write "<BR><INPUT type='Submit' value='Go'>"
%>
<BR>
</FORM>
</BODY>
</HTML>
"dnagel" <NO***********@hotmail.com> wrote in message
news:uP**************@tk2msftngp13.phx.gbl...
Christopher Johannsen wrote:
Good Day:
I am working on building a tool Using ASP/COM & IIS5.1 for a
non-administrative technical support team to change domain passwords for
users. I have the basic interface built and working from my developement
machine (Windows XP Pro SP 1A) which is hosting the pages for now. The
problem is that when I try to access the site from a browser on a
different pc using my credentials (IIS is running in Windows Authentication), it
appears that the ADSI queries stop working and I get the following
errors:
a.. Error Type:
(0x8007200A)
/ASP_TEST.ASP, line 64
which corresponds with a code that queries Active Directory for a
particular OU to return the users within that OU.
I am a newbie to ASP developement so maybe I am missing something really
trivial, like can I even accomplish this task in this manner?
Thanx in advance,
Christopher Johannsen
Network Administrator
United Communications, Inc.
I believe error 8007200a refers to the fact that you are requesting
an attribute that does not exist...
something about your attributes request is bad, or not permitted...
post the code?
D.