Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C#, LDAP, and Active Directory

C#, LDAP, and Active Directory

Scheduled Pinned Locked Moved C#
databasecsharpsql-serversysadminwindows-admin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    slvrscremr
    wrote on last edited by
    #1

    I have the following situation: Person A performs an application action that affects Person B. Management wants the application to automatically generate an e-mail to Person B, notifying them of the action. I can think of two solutions. 1) Query the Active Directory LDAP server for the e-mail address tied to Person B. 2) Get a dump of the e-mail addresses from the Exchange administrator and tie it into the application like another table. I don't like #2 because it doesn't account for change very well and I don't want to implement ANOTHER import/reconcile process if I don't have to. However, I've never done LDAP work and don't know how to exactly go about "eating this elephant". The proverbial answer is "one bite at a time", but where to start? :confused: BTW: The application is ASP. NET. The domain is Win Server 2000, Exchange 2000, and SQL Server 2000. Suggestions, pointers, hints, and help are welcome. Thanks in advance, Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

    S 1 Reply Last reply
    0
    • S slvrscremr

      I have the following situation: Person A performs an application action that affects Person B. Management wants the application to automatically generate an e-mail to Person B, notifying them of the action. I can think of two solutions. 1) Query the Active Directory LDAP server for the e-mail address tied to Person B. 2) Get a dump of the e-mail addresses from the Exchange administrator and tie it into the application like another table. I don't like #2 because it doesn't account for change very well and I don't want to implement ANOTHER import/reconcile process if I don't have to. However, I've never done LDAP work and don't know how to exactly go about "eating this elephant". The proverbial answer is "one bite at a time", but where to start? :confused: BTW: The application is ASP. NET. The domain is Win Server 2000, Exchange 2000, and SQL Server 2000. Suggestions, pointers, hints, and help are welcome. Thanks in advance, Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

      S Offline
      S Offline
      Scott Serl
      wrote on last edited by
      #2

      Look at the System.DirectoryServices namespace. You can use a DirectorySearcher object and get the user account. The property to look for is "mail". I just did a phone/email list for a company last week. I don't have any of the code, but if you get stuck on something, I might be able to help. When getting the value of a property from a DirectoryEntry object, always do a .Contains("prpertyname") before trying to access the property. Not every entry will have the property you are after.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups