Solved

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

Posted on 2007-04-11
3
306 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 250 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

730 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