Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2004, 02:18 PM
Registered User
Join Date: Feb 2004
Location: New York, New York, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Loding the groups to where a given user is partof

I trying to write an application that search for a given user in active directory and the groups that the given user is part of. The problem is that the user is under a organizational units (folder) and I am not able get to the information.
Bellow is the code that I am using. Can any one help me? Thank you

DirectoryEntry entry = new DirectoryEntry("LDAP://hq-2k3/cn=rtest,cn=IT,DC=kaneCompany,DC=com");
           Console.WriteLine(entry.Properties.Count.ToString( ));
            PropertyValueCollection col = entry.Properties["MemberOf"];
            IEnumerator enumerator = col.GetEnumerator();
                Console.WriteLine("Groups are " + enumerator.Current.ToString());
                //if this gives error then u might need to type case it to AD group object.

Thank you


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
get user groups from Active Directory PorcupineRabbit Classic ASP Professional 1 February 6th, 2007 08:09 PM
Groups Ma7T XSLT 1 August 25th, 2005 12:01 PM
User Groups survey Snib Forum and Wrox.com Feedback 1 January 21st, 2005 09:35 AM
Groups help in 8.5 for VS.net risu Crystal Reports 0 March 15th, 2004 04:27 PM

All times are GMT -4. The time now is 12:35 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.