Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

A question of active directory in asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mingjing - 03 Aug 2004 09:53 GMT
Hello ,everyone:

   I want to search domain user in active directory  uses those code ,but
the result not return domain user information ,
but only return the  domain computer ,how can I resolve the  problem!

System.DirectoryServices.DirectoryEntry entry =
  new
System.DirectoryServices.DirectoryEntry("LDAP://silan.com/DC=silan,DC=com");
 System.DirectoryServices.DirectorySearcher mySearcher = new
  System.DirectoryServices.DirectorySearcher(entry);
 mySearcher.Filter = ("(anr=chen)");
 string s = "";
 foreach(System.DirectoryServices.SearchResult result in
  mySearcher.FindAll())
   {
   s = result.GetDirectoryEntry().Path;
     Console.WriteLine(s );
   }
Shiva - 03 Aug 2004 12:26 GMT
Hi,
You might want to add (objectClass=user) to the filter condition and try.
Eg:
mySearcher.Filter = "(&(objectClass=user)(anr=chen))";

Hello ,everyone:

   I want to search domain user in active directory  uses those code ,but
the result not return domain user information ,
but only return the  domain computer ,how can I resolve the  problem!

System.DirectoryServices.DirectoryEntry entry =
  new
System.DirectoryServices.DirectoryEntry("LDAP://silan.com/DC=silan,DC=com");
 System.DirectoryServices.DirectorySearcher mySearcher = new
  System.DirectoryServices.DirectorySearcher(entry);
 mySearcher.Filter = ("(anr=chen)");
 string s = "";
 foreach(System.DirectoryServices.SearchResult result in
  mySearcher.FindAll())
   {
   s = result.GetDirectoryEntry().Path;
     Console.WriteLine(s );
   }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.