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. DirectorySearcher

DirectorySearcher

Scheduled Pinned Locked Moved C#
comsysadminquestion
2 Posts 2 Posters 4 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.
  • W Offline
    W Offline
    WizardOfPeyton
    wrote on last edited by
    #1

    I am not able to get a list of Users from my Domain Controller using a DirectorySearcher. I am catching an execption "A referral was returned from the server". I have added setting the RefferalChasing option to 'all' and I still get the same exception. The Domain, and Server are correct(changed here to protect the guilty). Does anyone have any ideas? DirectoryEntry Root = new DirectoryEntry("LDAP://Domain/cn=Users,DC=Server"); DirectorySearcher Searcher = new DirectorySearcher(Root); Searcher.ReferralChasing = ReferralChasingOption.All; try { SearchResultCollection Results = Searcher.FindAll(); foreach(SearchResult Res in Results) { Console.WriteLine(Result.Properties["cn"][0]); } } catch(Exception Ex) { Console.WriteLine(Ex.Message); } John Marshall JMarshall@aafcu.com

    M 1 Reply Last reply
    0
    • W WizardOfPeyton

      I am not able to get a list of Users from my Domain Controller using a DirectorySearcher. I am catching an execption "A referral was returned from the server". I have added setting the RefferalChasing option to 'all' and I still get the same exception. The Domain, and Server are correct(changed here to protect the guilty). Does anyone have any ideas? DirectoryEntry Root = new DirectoryEntry("LDAP://Domain/cn=Users,DC=Server"); DirectorySearcher Searcher = new DirectorySearcher(Root); Searcher.ReferralChasing = ReferralChasingOption.All; try { SearchResultCollection Results = Searcher.FindAll(); foreach(SearchResult Res in Results) { Console.WriteLine(Result.Properties["cn"][0]); } } catch(Exception Ex) { Console.WriteLine(Ex.Message); } John Marshall JMarshall@aafcu.com

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      http://codeproject.com/csharp/GroupAndMembers.asp[^] Mazy **"If I go crazy then will you still Call me Superman If I’m alive and well, will you be There holding my hand I’ll keep you by my side with My superhuman might Kryptonite"**Kryptonite-3 Doors Down

      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