Hi,
this is my code could anyone help me, I want to search exact user in special group in active directory, my group name is PID . could anyone here help me to do this.
OU = Users-Test
Group = PID
I want to search users under PID group in OU 'Users-Test'.
My code
string _path = LDAP://domain/CN=Users-Test,OU=Group,DC=aa,DC=xyz,DC=com;
dSearch.Filter =
{
loginName = GetProperty(sResultSet,
DirectorySearcher dSearch = new DirectorySearcher(_path);"(&(objectClass=user)(givenName=" + txtSearchEmployee.Text + "*))";foreach (SearchResult sResultSet in dSearch.FindAll())"cn"); // Login NameFirstName = GetProperty(sResultSet,
"givenName"); // First NameMiddleInitials = GetProperty(sResultSet,
"initials");// Middle NameLastName = GetProperty(sResultSet,
"sn"); // Last NameCompany = GetProperty(sResultSet,
"company"); // CompanyState = GetProperty(sResultSet,
"st"); //StateCity = GetProperty(sResultSet,
"l"); //CityCountry = GetProperty(sResultSet,
"co"); //CountryPostalcode = GetProperty(sResultSet,
"postalCode"); //PostalcodeTelephoneNumber = GetProperty(sResultSet,
Email = GetProperty(sResultSet,
"telephoneNumber");"mail"); //EmailuniqueName = GetProperty(sResultSet,
drpUsersList.Items.Add(newitem);
}
"mailnickname");ListItem newitem = new ListItem(uniqueName, uniqueName);
but it was not working.
please help me out.
Thanks.
Loading
Posted Jun 15, 2011, 9:40 AM
http://www.codeproject.com/KB/system/everythingInAD.aspx
chavaPosted Jun 16, 2011, 12:32 AM
http://www.eggheadcafe.com/articles/20051106.asp
and it's working fine.