Click here to Skip to main content
15,896,153 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get rid of delegate declarations Pin
Genbox15-Jun-07 9:15
Genbox15-Jun-07 9:15 
QuestionHow to make a Textbox only take numbers? Pin
dipuks14-Jun-07 6:43
dipuks14-Jun-07 6:43 
AnswerRe: How to make a Textbox only take numbers? Pin
Sathesh Sakthivel14-Jun-07 6:52
Sathesh Sakthivel14-Jun-07 6:52 
AnswerRe: How to make a Textbox only take numbers? Pin
Dave Kreskowiak14-Jun-07 7:06
mveDave Kreskowiak14-Jun-07 7:06 
AnswerRe: How to make a Textbox only take numbers? Pin
Hesham Yassin20-Jun-07 0:29
Hesham Yassin20-Jun-07 0:29 
QuestionDataGridView - Randomly re-arranging columns Pin
Tristan Rhodes14-Jun-07 5:43
Tristan Rhodes14-Jun-07 5:43 
AnswerRe: DataGridView - Randomly re-arranging columns Pin
Pualee14-Jun-07 6:21
Pualee14-Jun-07 6:21 
QuestionListing Active Directory Users ? [modified] Pin
ASysSolvers14-Jun-07 4:51
ASysSolvers14-Jun-07 4:51 
hi,
i want to list active directory users and same time get the login name of them...code are here..but gives an error here,
oResult.GetDirectoryEntry().Properties["cn"].Value


saying it is null...

code and path is correct because i can show oResults.Count saying it having

items..
My question is how to get userid and names...how to add properties to load DirectorySercher to get i
think it is not functioning...
here that i have coded.. im listing my code

im calling to method passing path like..
GetAllUsers("LDAP://test.lk/OU=sms,dc=test,dc=lk")
here is my code,...

public Hashtable GetAllUsers(string ldapServerName)<br />
{           <br />
   string _ldapServerName = ldapServerName;            <br />
   DirectoryEntry oRoot = new DirectoryEntry(ldapServerName);<br />
   DirectorySearcher oSearcher = new DirectorySearcher(oRoot);<br />
   SearchResultCollection oResults ;            <br />
   Hashtable RetArray =new Hashtable();<br />
   try<br />
   {<br />
      oSearcher.PropertiesToLoad.Add("uid");<br />
      oSearcher.PropertiesToLoad.Add("givenname");<br />
      oSearcher.PropertiesToLoad.Add("cn");<br />
      oResults = oSearcher.FindAll();<br />
      foreach (SearchResult oResult in oResults)<br />
      {<br />
        if (oResult.GetDirectoryEntry().Properties["cn"].Value.ToString()! "")<br />
       {<br />
          RetArray.Add(oResult.GetDirectoryEntry().Properties["uid"].Value,<br />
            oResult.GetDirectoryEntry().Properties["cn"].Value);<br />
       }<br />
      }<br />
   }<br />
catch(Exception e)<br />
{<br />
   MessageBox.Show("Error is " + e.Message);<br />
   return RetArray;<br />
}<br />
return RetArray;<br />
}


i oblidged u very much if u can provide me help on regarding..any resource

articles,sample code...

thanks in advance!

N:B
---------------------------------------------------------------------------

rootSearcher.PropertiesToLoad.Add(“name”); // Full name…
rootSearcher.PropertiesToLoad.Add(“mail”); // Primary email addy…
rootSearcher.PropertiesToLoad.Add(“telephoneNumber”); // Phone #...

like that i want to get the userID ?
plz.......tell me the correct statement for that ?






-- modified at 12:00 Thursday 14th June, 2007
AnswerRe: Listing Active Directory Users ? Pin
Manas Bhardwaj14-Jun-07 5:44
professionalManas Bhardwaj14-Jun-07 5:44 
QuestionData Source Configuration Wizard in VS2005 not accepting views with parameters Pin
Christopher Stratmann14-Jun-07 4:26
Christopher Stratmann14-Jun-07 4:26 
QuestionParsing each file in directory Pin
Rick van Woudenberg14-Jun-07 3:51
Rick van Woudenberg14-Jun-07 3:51 
AnswerRe: Parsing each file in directory Pin
Giorgi Dalakishvili14-Jun-07 3:57
mentorGiorgi Dalakishvili14-Jun-07 3:57 
AnswerRe: Parsing each file in directory Pin
Jimmanuel14-Jun-07 3:58
Jimmanuel14-Jun-07 3:58 
AnswerRe: Parsing each file in directory Pin
Rick van Woudenberg14-Jun-07 8:36
Rick van Woudenberg14-Jun-07 8:36 
QuestionFarm Database Pin
sajid.salim.khan14-Jun-07 3:37
sajid.salim.khan14-Jun-07 3:37 
JokeRe: Farm Database Pin
Not Active14-Jun-07 4:00
mentorNot Active14-Jun-07 4:00 
GeneralRe: Farm Database Pin
originSH14-Jun-07 4:03
originSH14-Jun-07 4:03 
GeneralRe: Farm Database Pin
DavidNohejl14-Jun-07 4:50
DavidNohejl14-Jun-07 4:50 
JokeRe: Farm Database Pin
Guffa14-Jun-07 7:57
Guffa14-Jun-07 7:57 
GeneralRe: Farm Database Pin
Paul Conrad14-Jun-07 10:33
professionalPaul Conrad14-Jun-07 10:33 
GeneralRe: Farm Database Pin
Dave Kreskowiak14-Jun-07 7:14
mveDave Kreskowiak14-Jun-07 7:14 
GeneralRe: Farm Database Pin
Not Active14-Jun-07 8:55
mentorNot Active14-Jun-07 8:55 
GeneralRe: Farm Database Pin
Dave Kreskowiak14-Jun-07 9:46
mveDave Kreskowiak14-Jun-07 9:46 
GeneralRe: Farm Database Pin
Paul Conrad14-Jun-07 10:33
professionalPaul Conrad14-Jun-07 10:33 
GeneralRe: Farm Database Pin
Dave Kreskowiak14-Jun-07 16:29
mveDave Kreskowiak14-Jun-07 16:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.