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
  1. Home
  2. General Programming
  3. Windows Forms
  4. Connecting to Active Directory

Connecting to Active Directory

Scheduled Pinned Locked Moved Windows Forms
windows-adminhelp
1 Posts 1 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.
  • J Offline
    J Offline
    John L Ponratnam
    wrote on last edited by
    #1

    I have a login form which will connect the Active Directory to check the user; but the output that i get is alway not couldn't connect. Boolean Success = false; DirectoryEntry Entry = new DirectoryEntry("LDAP://" + Domain, UserName, Password); DirectorySearcher Searcher = new DirectorySearcher(Entry); Searcher.SearchRoot = Entry; Searcher.Filter = "(&(objectClass=user)(sAMAccountName=" + UserName + "))"; Searcher.PropertiesToLoad.Add("cn"); Searcher.SearchScope = SearchScope.Subtree; try { //Test = UserExists(Domain, UserName, Password); SearchResult Results = Searcher.FindOne(); Success = (Results != null); } please help me to find the solution.

    Regards, John.L.Ponratnam

    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