chava

chava

  • NA
  • 25
  • 11.3k

search for specific group in active directory

Jun 15 2011 8:15 AM
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.

Answers (2)