TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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 Name
FirstName = GetProperty(sResultSet,
"givenName"
);
// First Name
MiddleInitials = GetProperty(sResultSet,
"initials"
);
// Middle Name
LastName = GetProperty(sResultSet,
"sn"
);
// Last Name
Company = GetProperty(sResultSet,
"company"
);
// Company
State = GetProperty(sResultSet,
"st"
);
//State
City = GetProperty(sResultSet,
"l"
);
//City
Country = GetProperty(sResultSet,
"co"
);
//Country
Postalcode = GetProperty(sResultSet,
"postalCode"
);
//Postalcode
TelephoneNumber = GetProperty(sResultSet,
Email = GetProperty(sResultSet,
"telephoneNumber"
);
"mail"
);
//Email
uniqueName = GetProperty(sResultSet,
drpUsersList.Items.Add(newitem);
}
"mailnickname"
);
ListItem
newitem =
new
ListItem
(uniqueName, uniqueName);
but it was not working.
please help me out.
Thanks.
Reply
Answers (
2
)
CAPTURING LOGON INFORMATION FROM ACTIVE DIRECTORY USING ASP.NET WEB APPLICATION AUTHENTICATION
Logon problem