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
3,067 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 58

Accepted Solution

by:
Julian Hansen earned 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

615 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