Problems with ADSI, LDAP in ASP page adding user...

Hello,
I'm having problems with an asp driven utility that my company uses to add AD users via ADSI. We moved the utility to a new server, and now I get a general access denied error. Below is test code that works fine on our old server, but not on the new one. Looks like permissions problems to me, but I'm a newb when it comes to setting permisions. Any suggestions?

<!--#include file="adovbs.asp"-->
<%
'On Error Resume Next

Dim objRootDSE, objContainer, objUser

strsAMAccountName = "JohnDoe"
strUser = "cn=" & strsAMAccountName
strDescription = "User via ADSI"
strgivenName = "John"
strsn = "Doe"
strdisplayName = strgivenName & " " & strsn

'create user
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & objRootDSE.Get("defaultNamingContext"))
Set objUser = objContainer.Create("user", strUser)

objUser.Put "sAMAccountName", strsAMAccountName
objUser.Put "description", strDescription
objUser.Put "givenName", strgivenName
objUser.Put "sn", strsn
objUser.Put "displayName", strdisplayName
objUser.Put "name", strsAMAccountName
objUser.Put "HomeDirectory", application("appdir") & strsAMAccountName
objUser.SetInfo  <<<<Code fails here<<<<
%>
web_benAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
sirbountyConnect With a Mentor Commented:
What user context is this running under?  That account would need permissions to modify objects in Active Directory.
Presumably you're using the limited account for your web site?
0
 
web_benAuthor Commented:
Thanks sirbounty,
That was the perfect question to get me going.      :)
0
 
sirbountyCommented:
Glad I could help! Thanx. :^)
0
All Courses

From novice to tech pro — start learning today.