Solved

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

Posted on 2007-04-11
3
304 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
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…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

776 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