Error editing and deleting AD

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bryan Yeo

    Error editing and deleting AD

    Got no problem adding an AD account using the LDAP connection, but error
    when finding a record to edit:

    DirectoryEntry entry = new DirectoryEntry( "LDAP://MyDomainName,
    DC=MyDomainName );
    DirectoryEntrie s entriesChild= entry.Children;
    DirectoryEntry entryCheck = entriesChild.Fi nd("bryantest") ;
    //Error: An invalid dn syntax has been specified

    try
    {
    object ret = entry.Invoke("C hangePassword", new object[]{ OldPassword,
    NewPassword });
    entry.CommitCha nges ();
    }
    catch(Exception excp)
    {
    throw(excp);
    }


    if ( entryCheck != null)
    entriesChild.Re move(entryCheck );



    Thanks
    Bryan


  • Willy Denoyette [MVP]

    #2
    Re: Error editing and deleting AD


    "Bryan Yeo" <bryanyeo@comme rce.com.sg> wrote in message news:uyBp8rndDH A.1792@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Got no problem adding an AD account using the LDAP connection, but error
    > when finding a record to edit:
    >
    > DirectoryEntry entry = new DirectoryEntry( "LDAP://MyDomainName,
    > DC=MyDomainName );
    > DirectoryEntrie s entriesChild= entry.Children;
    > DirectoryEntry entryCheck = entriesChild.Fi nd("bryantest") ;[/color]

    ..... entriesChild.Fi nd("cn=bryantes t");

    or better use the overload and supply the schemaclass name:

    entriesChild.Fi nd("cn=bryantes t", "User");

    Willy.






    Comment

    • Bryan Yeo

      #3
      Re: Error editing and deleting AD

      Tried both and got this error: "There is no such object on the server."

      Regards
      Bryan

      "Willy Denoyette [MVP]" <willy.denoyett e@pandora.be> wrote in message
      news:utWodgqdDH A.1876@TK2MSFTN GP12.phx.gbl...[color=blue]
      >
      > "Bryan Yeo" <bryanyeo@comme rce.com.sg> wrote in message[/color]
      news:uyBp8rndDH A.1792@TK2MSFTN GP12.phx.gbl...[color=blue][color=green]
      > > Got no problem adding an AD account using the LDAP connection, but error
      > > when finding a record to edit:
      > >
      > > DirectoryEntry entry = new DirectoryEntry( "LDAP://MyDomainName,
      > > DC=MyDomainName );
      > > DirectoryEntrie s entriesChild= entry.Children;
      > > DirectoryEntry entryCheck = entriesChild.Fi nd("bryantest") ;[/color]
      >
      > .... entriesChild.Fi nd("cn=bryantes t");
      >
      > or better use the overload and supply the schemaclass name:
      >
      > entriesChild.Fi nd("cn=bryantes t", "User");
      >
      > Willy.
      >
      >
      >
      >
      >
      >[/color]


      Comment

      Working...