Re: LDAP binding

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 07/23/04


Date: Fri, 23 Jul 2004 09:26:53 -0500

You just need to know the names of the attributes that store those values. Based on the syntax you have below, you can get the additional values using the same syntax as you used for displayName.

I'd suggest using a tool like ldp.exe or ADSI Edit to view all of the available AD data for a user and figure out what all the attribute names are. Then, you can translate that to your code.

If you want to do queries against AD instead of binding to specific objects, you should use the DirectorySearcher.

Most of the support for this stuff goes on in microsoft.public.adsi.general (.NET and COM). Also, there's good stuff in the Directory Services SDK documentation in MSDN.

Joe K.
  "Mike" <nospam@nospam.com> wrote in message news:eJwgGsGcEHA.4032@TK2MSFTNGP11.phx.gbl...

  Thanks Joe. I can now see the various properties.

  Is there a possibility to query the Active Directory to gather some information about the user (group, phone, etc.)? How can I do that?

  Thanks.
  Mike

  "Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote in message news:eY5PbwDcEHA.3460@TK2MSFTNGP10.phx.gbl...
    In order to use an unqualified username, you must specify AuthenticationTypes.Secure (which you should do anyway to ensure that your credentials are encrypted on the network). You can also use the upn syntax (user@domain.com) or NT Logon format (domain\user) with or without AuthenticationTypes.Secure.

    Joe K.

      "Mike" <nospam@nospam.com> wrote in message news:OTui1IDcEHA.2008@TK2MSFTNGP10.phx.gbl...

      Hi,

      I am trying to bind to an Active Directory server using the following snippet, but I always get a user unknown or bad password error message.
          DirectoryEntry de = new DirectoryEntry(LDAP://srv-dell.waysoft.local);
          de.AuthenticationType = AuthenticationTypes.ServerBind;
          de.Username = "administrator";
          de.Password = "password";
          string usr = de.Properties["DisplayName"].Value.ToString(); // the error message appears here

      Any idea of what is wrong?

      Thanks.
      Mike



Relevant Pages

  • Re: Help - need to change an attribute value
    ... I haven't done a ton of schema mods in my day and have never ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... All I need to change is the syntax - we have it set at "Case Sensitive ...
    (microsoft.public.windows.server.active_directory)
  • Re: Help - need to change an attribute value
    ... What tool can I use to rename? ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... All I need to change is the syntax - we have it set at "Case Sensitive ...
    (microsoft.public.windows.server.active_directory)
  • Re: Select with aliases, please help
    ... The UPDATE FROM syntax will give you a random result. ... Hi Joe, ... the column to NULL in all rows that have no qualifying store. ...
    (comp.databases.ms-sqlserver)
  • Re: update more than 1 col with SELECT
    ... The syntax that should work: ... Compass Technology Management ... All other replies will be ignored:) ... "Joe" wrote in message ...
    (microsoft.public.sqlserver.programming)
  • Re: VLOOKUP- concatenate 2 cells
    ... Joe ... > Excel and Word Function Lists (Classifications, Syntax and Arguments) ...
    (microsoft.public.excel.worksheet.functions)