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,063 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 57

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article will show, step by step, how to integrate R code into a R Sweave document
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?

710 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