Solved

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

Posted on 2007-04-11
3
299 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
Comment Utility
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
Comment Utility
Thanks sirbounty,
That was the perfect question to get me going.      :)
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Glad I could help! Thanx. :^)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

      Install BugTracker on Windows 2008 server Step 1:  Install windows 2008 server 32 bit OS and configure IIS. Step 2:  Install SQL server ( SQL server 2005 or SQL server 2005 Express edition. The installer for 2008  version isn’t very f…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now