Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting an asp page to make a user in active directory

Status
Not open for further replies.

tascii

Technical User
May 28, 2011
6
0
0
CA
I have no idea why i can't get my asp page to access my ad,
so all i need to do is make a user on my site by im running into a wall, i think i may need to authenticate but i don't know what to do.
i can get it to recall whatever i put into it


<html>
<body>

<table border="1">
<form action="makeus.asp" method="post">
<tr>
Make user
</tr>
<tr>
<th>
User Name
</th>
<th>
<input type="text" name="uname"/>
</th>
</tr>
<tr>
<th>
Password
</th>
<th>
<input type="text" name="fpass"/>
</th>
</tr>
<tr>
<th>
Re-enter
Password
</th>
<th>
<input type="text" name="spass"/>
</th>
</tr>
<tr>
<th>
First name
</th>
<th>
<input type="text" name="fname"/>
</th>
</tr>
<tr>
<th>
Inital
</th>
<th>
<input type="text" name="iname"/>
</th>
</tr>
<tr>
<th>
Last name
</th>
<th>
<input type="text" name="lname"/>
</th>
</tr>
<tr>
<th>
Display name
</th>
<th>
<input type="text" name="dname"/>
</th>
</tr>
<tr>
<th>
Description
</th>
<th>
<input type="text" name="desc"/>
</th>
</tr>
<tr>
<th>
Telephone #
</th>
<th>
<input type="text" name="tele"/>
</th>
</tr>
<tr>
<th>
E-mail
</th>
<th>
<input type="text" name="email"/>
</th>
</tr>
<tr>
<th>
</th>
<th>
<input type="submit" value="Submit"/>
</th>
</tr>
</form>
</table>
<table>

<%
dim useratr(10)
useratr(0)=Request.Form("uname")
useratr(1)=request.form("fpass")
useratr(2)=request.form("spass")
useratr(3)=request.form("fname")
useratr(4)=request.form("iname")
useratr(5)=request.form("lname")
useratr(6)=request.form("dname")
useratr(7)=request.form("desc")
useratr(8)=request.form("tele")
useratr(9)=request.form("email")
if useratr(1) <> useratr(2) then
response.write("password isn't the same")
else
Set objOU = GetObject("LDAP://cn=Users,dc=someome,dc=domain")
Set objUser = objOU.Create("User", "cn=" & useratr(0))
objUser.Put "sAMAccountName", useratr(0)
objUser.Put "givenName", useratr(3)
objUser.Put "initials", useratr(4)
objUser.Put "sn", useratr(5)
objUser.Put "displayName", useratr(6)
objUser.Put "description", useratr(7)
objuser.Put "telephoneNumber", useratr(8)
objuser.Put "mail", useratr(9)
objUser.SetInfo
objUser.SetPassword useratr(1)
objUser.SetInfo
response.write "user "& useratr(0) &" has been made"
end if
%>
</body>
</html>
 
Is the webserver also a DC or just a member?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
no, i have a dc and then a server just for iis

the only thing that can't be patched is stupidity.
 
The only way I could get AD script to work was to run IIS on the DC or BDC and have the website running as a user that had AD adinistrative access.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
ok ill try that

the only thing that can't be patched is stupidity.
 
nope not working. just made an iis on my dc and tried it, still isn't working


the only thing that can't be patched is stupidity.
 
never mind found out how to make it work, somehow

the only thing that can't be patched is stupidity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top