Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 20th, 2004, 08:01 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Searching Active Directory

Im new to c# asp programing and would like some help with the following.

I’m trying to search active directory for a specific users “schenkp” for this case and have results outputting to a list box. Say the user is schenkp I would like to know what groups he is a member of that have the specific word “owner”.

I have a web page that consist of a button, list box and a text box. This code works and returns all the member of the active directory so far when I click the button.


private void Button1_Click(object sender, System.EventArgs e)
        {
            DirectoryEntry de = new DirectoryEntry("LDAP://GCM.COM/ou=user accounts,ou=accounts,dc=gcm,dc=com","schenkp","mat terhorn");
            foreach(DirectoryEntry child in de.Children)
            {
                ListBox1.Items.Add(child.Name.Remove(0,3));
            }

        }



Any help would be greatly appreciated,


 
Old September 20th, 2004, 08:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Did you try using the DirectorySearcher object instead?

Brian
 
Old September 21st, 2004, 06:55 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No i have no clue how to utiize teh directory searcher.... do you?

 
Old September 21st, 2004, 07:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Some info: http://msdn.microsoft.com/library/de...etadsearch.asp

Brian
 
Old September 21st, 2004, 11:35 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the link, been there and have tried it. Im tring to search for a "word" under the memeber of tab of a paticular users. the "word" is normaly on the discription of the group.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for a user in Active Directory with ASP Ricapar Classic ASP Professional 1 July 15th, 2008 11:07 PM
Searching Active Directory mendezw@hotmail.com General .NET 0 November 30th, 2004 12:10 PM
Searching Directory Engine Renich PHP How-To 4 October 29th, 2004 09:07 AM
Searching Active Directory levinll VB How-To 1 June 8th, 2004 08:47 AM
Active Directory Searching schenkp C# 1 July 11th, 2003 03:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.