Link to home
Start Free TrialLog in
Avatar of kdeutsch
kdeutschFlag for United States of America

asked on

Query Active Directory groups and add individuals to datagrid

Never done this before and don't know where to start, I need to query active directory groups and then add the users that are in those groups to a datagrid.  How can I do this.  Can build the datagrid easy but know nothing about querying active directory from asp.net 1.1.  Please help
Thanks
Avatar of sujeshva
sujeshva

You want to lookup users from a given AD group?
Avatar of kdeutsch

ASKER

Correct I need to be able to query 8 different active directory groups and pull out these users in a sql query and then put it into asp.net and populate a datagrid.  Once the query is built I can handle rest but don't know syntaxes to query AD.
ok, just for starters, Google System.DirectoryServices. I am in the middle of something and cant write the code to test it. Read it, it has everything you are looking for and probably will have a solution even before I get to it.

-Suj
ASKER CERTIFIED SOLUTION
Avatar of kdeutsch
kdeutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
Ok I found how to insert into permenent table by adding this to the method  I added it right before the Select statement at the bottom, don't know it its correct way to do but it works.  So teh questions i have left are
1.  How can I pull email with this statement as well
2. How can I turn into a sql query statement or a stored procedure that I can run via an asp.net program.

INSERT INTO [IAComplianceDotNet].[dbo].[tblADAccounts]
           ([strName]
           ,[strAccount])
Here's another way to do it all in C#.

Read all users:
http://www.codeproject.com/KB/system/everythingInAD.aspx

Add it to the database / query from the database to display it on the grid.
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx


Please don't delete this issue. It has some valuable information from experts that others may find useful.