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,050 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
3 Comments
 
LVL 51

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 90
How  do I get an older program to run in Windows 10? 20 80
move one pixel 4 41
Java Loop 4 14
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
This is an explanation of a simple data model to help parse a JSON feed
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

758 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

21 Experts available now in Live!

Get 1:1 Help Now