foreach (System.DirectoryServices.SearchResult result in mySearcher.FindAll())
{
if (result.GetDirectoryEntry().Properties["givenName"].Value != null)
Label1.Text = "First Name : "
+ result.GetDirectoryEntry().Properties["givenName"].Value.ToString();
}
}
Impersonate=true;
all these settings i made in my program. uploaded to iis and its working my local PC with windows authentication.
but if i am try from other pc error is throwing "An Operation error Occoured"
Hi the above code working fine but i have one problem , the same name have more than one user in diffrent DL that is also coming, i want under
that DL user list alone for example(in my organizantion have two sureshbabump is system will return two line item but one user only comes under this DL another user will not)
jithabc
Member
6 Points
40 Posts
Re: Displaying Members in a Distribution List
Jun 14, 2010 07:51 AM|LINK
Dear there is an
error is throwing "An Operation error Occoured" here is my coding
DirectoryEntryenTry = new DirectoryEntry(LDAP:///DC=DOMAIN NAME,DC=local);
mySearcher.Filter = DirectorySearcher mySearcher = new DirectorySearcher(enTry);"(&(objectClass=user)(anr=" + strUser + "))";
{
DirectorySearcher mySearcher = new DirectorySearcher(enTry);
mySearcher.Filter = "(&(objectClass=user)(anr=" + strUser + "))";
foreach (System.DirectoryServices.SearchResult result in mySearcher.FindAll())
{
if (result.GetDirectoryEntry().Properties["givenName"].Value != null)
Label1.Text = "First Name : "
+ result.GetDirectoryEntry().Properties["givenName"].Value.ToString();
}
}
Impersonate=true;
all these settings i made in my program. uploaded to iis and its working my local PC with windows authentication.
but if i am try from other pc error is throwing "An Operation error Occoured"
can you help in this
regards
jith
sureshbabump
Member
2 Points
1 Post
Re: Displaying Members in a Distribution List
Sep 27, 2011 03:37 PM|LINK
Hi the above code working fine but i have one problem , the same name have more than one user in diffrent DL that is also coming, i want under
that DL user list alone for example(in my organizantion have two sureshbabump is system will return two line item but one user only comes under this DL another user will not)
please help as to solve this problem.
dsSearch.Filter = "CN=" + objName.Substring(selIndex, selEnd).Replace("\\", "");
foreach (SearchResult rs in dsSearch.FindAll())
{
str1 += "<p align='right'><font face='calibri' color='#2266aa' size=2>" + Convert.ToString(rs.GetDirectoryEntry().Properties["mail"].Value) + "|" + Convert.ToString(rs.GetDirectoryEntry().Properties["displayName"].Value) + "|" + Convert.ToString(rs.GetDirectoryEntry().Properties["sAMAccountName"].Value) + "|" + Convert.ToString(rs.GetDirectoryEntry().Properties["department"].Value) + "|" + Convert.ToString(rs.GetDirectoryEntry().Properties["memberOf"].Value) + "</font></p>";
}
the above codewill loop two times, please help as solve the proble it is little bit urgent
GopaalKrishn...
Member
4 Points
7 Posts
Re: Displaying Members in a Distribution List
Aug 10, 2012 10:34 AM|LINK
Hi Aravind,
I think you will assit me regarding the Distribution List.
how to give LDAP for my active directory , here i have using the Outlook Miscrosoft Exchange.
my server details resembles like this "gladiator.gms.com"
How to give my port details here ie 389.
I do not have knowledge about Distribution list and Microsoft exchange server.
I think you all will help be regarding this.
How use Microsoft exchange server for outlook.
And modify the code mentioned as above and assist me.
GopaalKrishn...
Member
4 Points
7 Posts
Re: Displaying Members in a Distribution List
Aug 10, 2012 12:46 PM|LINK
foreach(SearchResult AdObj in search.FindAll())
Once my code reach this line, it come out, without any exception it prints only the empty values