?
Solved

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

Posted on 2007-04-11
3
Medium Priority
?
315 Views
Last Modified: 2012-06-27
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<<<<
%>
0
Comment
Question by:web_ben
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 1000 total points
ID: 18890728
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
 

Author Comment

by:web_ben
ID: 18892143
Thanks sirbounty,
That was the perfect question to get me going.      :)
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18892164
Glad I could help! Thanx. :^)
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question