-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Devesh
Message 1 in Discussion

I have written a function which returns all the users email id of active directory. 
these email id I populate it in listbox. but it also returns a value like 
systemmainbox{019C691A-66BA-4A29-A1EE-598AFC5D2C18}. i have exchange 2000 installed in 
same domain controller. i dont want this value to appear. this is the function used. 
its a web application. 
Public Function FunGetActiveDirectoryUsers() As String() 
               Dim strDomain As String = "test.com 
               Dim entry As New System.DirectoryServices.DirectoryEntry("LDAP://"; + 
strDomain) 
               Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry) 
               mySearcher.Filter = "(objectClass=user)" 
               Dim resEnt As System.DirectoryServices.SearchResult 
               Dim intCounter As Integer = mySearcher.FindAll.Count - 1 
               Dim strADUsers(intCounter) As String 
               intCounter = 0 
               For Each resEnt In mySearcher.FindAll() 
                              Try 
                                             Dim de As 
System.DirectoryServices.DirectoryEntry = resEnt.GetDirectoryEntry() 
                                             strADUsers(intCounter) = 
de.Properties("Mail").Value.ToString() 
                                             intCounter += 1 
                              Catch e As Exception 
                              End Try 
               Next resEnt 
               FunGetActiveDirectoryUsers = strADUsers 
End Function 
 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to