Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

When using ADSI to create user, error returned as "80072035 The server is unwilling to process the request".

Posted on 2004-10-06
3
Medium Priority
?
3,076 Views
Last Modified: 2008-01-09
Hi all, I use the ADSI in VB6.0 to create user as following:

Dim sPrefix, sContainerDN, sadminname, sadminpwd
Dim sUser
sPrefix="LDAP://temp.company.net/"
sContainerDN="OU=Person,OU=companySSO,DC=company,DC=net"
sadminname="COMPANYNET\administrator"
sadminpwd="password"

Dim oNameSpace, oOUCont
Set oNameSpace = GetObject("LDAP:")
Set oOUCont = oNameSpace.OpenDSObject(sPrefix & sContainerDN, sadminname, sadminpwd, 0)
Set User = oOUCont.Create("user", "cn=test0001")
User.Put "samAccountName", "test0001"
User.SetInfo     ' <- error occur here

If Err.Number <> 0 Then
  MsgBox Err.Number & ": " & Err.Description & " - " & Err.Source
else
  Msgbox "Success"
End If

The returned error occurred at User.SetInfo and the error is: "80072035 The server is unwilling to process the request".
Could anyone give me some hints?

Thanks a lot.
0
Comment
Question by:heikan
[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
3 Comments
 
LVL 59

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 12236479
I modified your script slightly as shown below. By specifying the CN=Users in the DNName field it worked successfully. I am not sure about how your environment is setup but try modifying your script accordingly.


Dim sPrefix, sContainerDN, sadminname, sadminpwd
Dim sUser
sPrefix="LDAP://marcorp/" <--- I did not use this but you can modify based on change below
sContainerDN="OU=Person,OU=companySSO,DC=company,DC=net" <--- I did not use this but you can modify based on change below
sadminname="Marcorp\administrator"
sadminpwd="tqbfjotld"

Dim oNameSpace, oOUCont
Set oNameSpace = GetObject("LDAP:")
Set oOUCont = oNameSpace.OpenDSObject("LDAP://cn=users,DC=mydomain,DC=local", sadminname, sadminpwd, 0)   <---- changed the object definition
Set User = oOUCont.Create("user", "cn=test0001")
User.Put "samAccountName", "test0001"
User.SetInfo     ' <- error occur here

If Err.Number <> 0 Then
  MsgBox Err.Number & ": " & Err.Description & " - " & Err.Source
else
  Msgbox "Success"
End If
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Progress

671 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