Home All Groups Group Topic Archive Search About
Author
13 Nov 2006 9:10 PM
will
I'm receiving the following error when attempting add a new user to the AD.
The user account used have enterprise level rights. Any help would be greatly
appreciated. Thanks! - Will

An invalid dn syntax has been specified. (Exception from HRESULT: 0x80072032)"

CODE:

Try
    objADAM = New DirectoryEntry("LDAP://<domain>.com, "userid", "password",
AuthenticationTypes.Secure)
  objADAM.RefreshCache()
'
   objUser = objADAM.Children.Add(strUser, "user")
   objUser.Properties("displayName").Add(strDisplayName)
  objUser.Properties("userPrincipalName").Add( _
                        strUserPrincipalName)
  objUser.CommitChanges()
Catch ....

  Dim lastname As String = "test"
  Dim firstname As String = "user"
  Dim email As String = "tu***@casmanagerpro.com"
  '
  strUser = "CN=" & lastname & "," & firstname
  strDisplayName = lastname & "," & firstname
  strUserPrincipalName = email

Author
13 Nov 2006 10:16 PM
Joe Kaplan
You might like ch 10 of our book to help with some of this stuff.  It is
free from the website in my sig.  There is also free VB.NET code on the site
from the book.

There are also a few ADAM specific things to do here.  You need to specific
the application partition NC Name in your binding string in order for LDAP
to know where in ADAM to put the user:

LDAP://adamdnsname/OU=Users,O=myadampartition

(or whatever you created there)

Also, what is the value of strUser in the code below?  It needs to be in
"RDN" format, ie "cn=someuser", assuming that you are creating an object
with the ADAM user schema and not something else.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"will" <w***@discussions.microsoft.com> wrote in message
news:8C425E14-D43A-442F-A500-863F6DC68EE0@microsoft.com...
> I'm receiving the following error when attempting add a new user to the
> AD.
> The user account used have enterprise level rights. Any help would be
> greatly
> appreciated. Thanks! - Will
>
> An invalid dn syntax has been specified. (Exception from HRESULT:
> 0x80072032)"
>
> CODE:
>
> Try
>    objADAM = New DirectoryEntry("LDAP://<domain>.com, "userid",
> "password",
> AuthenticationTypes.Secure)
>  objADAM.RefreshCache()
> '
>   objUser = objADAM.Children.Add(strUser, "user")
>   objUser.Properties("displayName").Add(strDisplayName)
>  objUser.Properties("userPrincipalName").Add( _
>                        strUserPrincipalName)
>  objUser.CommitChanges()
> Catch ....
>
>  Dim lastname As String = "test"
>  Dim firstname As String = "user"
>  Dim email As String = "tu***@casmanagerpro.com"
>  '
>  strUser = "CN=" & lastname & "," & firstname
>  strDisplayName = lastname & "," & firstname
>  strUserPrincipalName = email
>
>
>
>
Author
14 Nov 2006 2:41 PM
will
Hello Joe:

Thanks for the response.  The values I used for the

strUser = "CN=lastname , firstname"
userPrincipalName = "tu***@casmanagerpro.com"
displayName = "lastname , firstname"

The objADAM  a  DirectoryEntry object. How do I know what schema is being
used?  I'm confused about Active Directory and ADAM - they appear to be
interchangable terms yet with what I've read thus far there is a slight
difference. The target servers are Win 2003, developement box is WinXP Pro. I
installed ADAM adsiedit but I can't find the GAL entries.

When I look at the GAL via outlook, the far right column (Email) of the
address book shows the hierachy of the contact entry. An example,
/o=SIS/ou=First Group/cn=Recipients/cn=1test.

So while I'm in ADAM adsiedit I specify cn=Recipients and expect to get a
listing of the entries under that cn. In stead when I enter cn=Recipients
ADAm tool errors with "subref missing". Sorry for the off-topic ADAM issue
but I was hoping that a tool could provide me with some insight to the
AD/ADAM. I'm going to buy your book today. I did use the code fragments to
create a user for what I have now but I'm lacking the basic AD/ADAM knowledge.

Thanks again,
-Will

I

Show quoteHide quote
"Joe Kaplan" wrote:

> You might like ch 10 of our book to help with some of this stuff.  It is
> free from the website in my sig.  There is also free VB.NET code on the site
> from the book.
>
> There are also a few ADAM specific things to do here.  You need to specific
> the application partition NC Name in your binding string in order for LDAP
> to know where in ADAM to put the user:
>
> LDAP://adamdnsname/OU=Users,O=myadampartition
>
> (or whatever you created there)
>
> Also, what is the value of strUser in the code below?  It needs to be in
> "RDN" format, ie "cn=someuser", assuming that you are creating an object
> with the ADAM user schema and not something else.
>
> Joe K.
>
> --
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "will" <w***@discussions.microsoft.com> wrote in message
> news:8C425E14-D43A-442F-A500-863F6DC68EE0@microsoft.com...
> > I'm receiving the following error when attempting add a new user to the
> > AD.
> > The user account used have enterprise level rights. Any help would be
> > greatly
> > appreciated. Thanks! - Will
> >
> > An invalid dn syntax has been specified. (Exception from HRESULT:
> > 0x80072032)"
> >
> > CODE:
> >
> > Try
> >    objADAM = New DirectoryEntry("LDAP://<domain>.com, "userid",
> > "password",
> > AuthenticationTypes.Secure)
> >  objADAM.RefreshCache()
> > '
> >   objUser = objADAM.Children.Add(strUser, "user")
> >   objUser.Properties("displayName").Add(strDisplayName)
> >  objUser.Properties("userPrincipalName").Add( _
> >                        strUserPrincipalName)
> >  objUser.CommitChanges()
> > Catch ....
> >
> >  Dim lastname As String = "test"
> >  Dim firstname As String = "user"
> >  Dim email As String = "tu***@casmanagerpro.com"
> >  '
> >  strUser = "CN=" & lastname & "," & firstname
> >  strDisplayName = lastname & "," & firstname
> >  strUserPrincipalName = email
> >
> >
> >
> >
>
>
>
Author
14 Nov 2006 3:29 PM
Joe Kaplan
Why do you have to ruin your life by putting characters that must be escaped
into your RDN?  You'll regret that for the rest of the time you use the
directory!  :)

Honestly, if you absolutely must put the comma in the CN, you need to escape
it with a backslash.  I'd strongly recommend you avoid any urge to do so.
It is fine in the displayName though.

The important thing to know about ADAM is that out of the box, it has a very
limited schema and a ton of flexibility that AD doesn't have.  AD has a
specific schema built in that makes the AD "work".  Since ADAM doesn't have
to do anything by default, it doesn't come with much schema.  By default,
there is no user class.  The designers allow you to create your own schema
to do whatever you want.  It is possible (and perhaps likely) that you added
the schema that contains the default "user" class when you installed ADAM,
but this is not required by any stretch.

As such, there is no particular requirement that a bindable object be
created using the "user" class at all.

I'd suggest starting another thread on the other issue related to ADAM and
the GAL so this one doesn't get buried.  Let's just try to get your code
working for now.  :)

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"will" <w***@discussions.microsoft.com> wrote in message
news:699B9CED-DD8C-4405-8688-85CFC129E530@microsoft.com...
> Hello Joe:
>
> Thanks for the response.  The values I used for the
>
> strUser = "CN=lastname , firstname"
> userPrincipalName = "tu***@casmanagerpro.com"
> displayName = "lastname , firstname"
>
> The objADAM  a  DirectoryEntry object. How do I know what schema is being
> used?  I'm confused about Active Directory and ADAM - they appear to be
> interchangable terms yet with what I've read thus far there is a slight
> difference. The target servers are Win 2003, developement box is WinXP
> Pro. I
> installed ADAM adsiedit but I can't find the GAL entries.
>
> When I look at the GAL via outlook, the far right column (Email) of the
> address book shows the hierachy of the contact entry. An example,
> /o=SIS/ou=First Group/cn=Recipients/cn=1test.
>
> So while I'm in ADAM adsiedit I specify cn=Recipients and expect to get a
> listing of the entries under that cn. In stead when I enter cn=Recipients
> ADAm tool errors with "subref missing". Sorry for the off-topic ADAM issue
> but I was hoping that a tool could provide me with some insight to the
> AD/ADAM. I'm going to buy your book today. I did use the code fragments to
> create a user for what I have now but I'm lacking the basic AD/ADAM
> knowledge.
>
> Thanks again,
> -Will
>
> I
>
> "Joe Kaplan" wrote:
>
>> You might like ch 10 of our book to help with some of this stuff.  It is
>> free from the website in my sig.  There is also free VB.NET code on the
>> site
>> from the book.
>>
>> There are also a few ADAM specific things to do here.  You need to
>> specific
>> the application partition NC Name in your binding string in order for
>> LDAP
>> to know where in ADAM to put the user:
>>
>> LDAP://adamdnsname/OU=Users,O=myadampartition
>>
>> (or whatever you created there)
>>
>> Also, what is the value of strUser in the code below?  It needs to be in
>> "RDN" format, ie "cn=someuser", assuming that you are creating an object
>> with the ADAM user schema and not something else.
>>
>> Joe K.
>>
>> --
>> Joe Kaplan-MS MVP Directory Services Programming
>> Co-author of "The .NET Developer's Guide to Directory Services
>> Programming"
>> http://www.directoryprogramming.net
>> --
>> "will" <w***@discussions.microsoft.com> wrote in message
>> news:8C425E14-D43A-442F-A500-863F6DC68EE0@microsoft.com...
>> > I'm receiving the following error when attempting add a new user to the
>> > AD.
>> > The user account used have enterprise level rights. Any help would be
>> > greatly
>> > appreciated. Thanks! - Will
>> >
>> > An invalid dn syntax has been specified. (Exception from HRESULT:
>> > 0x80072032)"
>> >
>> > CODE:
>> >
>> > Try
>> >    objADAM = New DirectoryEntry("LDAP://<domain>.com, "userid",
>> > "password",
>> > AuthenticationTypes.Secure)
>> >  objADAM.RefreshCache()
>> > '
>> >   objUser = objADAM.Children.Add(strUser, "user")
>> >   objUser.Properties("displayName").Add(strDisplayName)
>> >  objUser.Properties("userPrincipalName").Add( _
>> >                        strUserPrincipalName)
>> >  objUser.CommitChanges()
>> > Catch ....
>> >
>> >  Dim lastname As String = "test"
>> >  Dim firstname As String = "user"
>> >  Dim email As String = "tu***@casmanagerpro.com"
>> >  '
>> >  strUser = "CN=" & lastname & "," & firstname
>> >  strDisplayName = lastname & "," & firstname
>> >  strUserPrincipalName = email
>> >
>> >
>> >
>> >
>>
>>
>>