0

I have been trying unsuccessfully to code an Active Directory searcher that displays a list of users in a drop-down list.

For instance if you select a user from a drop-down list of Users, the manager or managers that the user belongs to will populate a second drop-down list with the manager of the selected user as the first option on the list.

I can handle the Cascading of the drop-down lists, what I have been having trouble with is relating users to managers.

I am turning to SQL Gurus to see if it is possible to use SQL Server to grab users and the managers they are related to from Active Directory and populate a SQL Server database. Then I can use my .NET app to populate the drop-down lists as described above.

I have Googled the web to death but have come up empty.

Is this possible?

Pondlife
  • 15,992
  • 6
  • 37
  • 51
Kenny
  • 1,058
  • 4
  • 20
  • 49
  • Is this question helpful? http://stackoverflow.com/questions/981621/finding-a-users-manager-record-in-active-directory – Pondlife Feb 06 '13 at 20:03
  • sorry, my apologies, I misunderstood your question. – Kenny Feb 06 '13 at 20:35
  • No problem, I didn't completely understand your question because it seems that your main problem is finding the link between a user and a manager, and exporting the data into SQL Server won't help with that: you still need to identify the relationship. If you can query AD directly for this then it would be simplest; perhaps using SQL Server would be faster for some tasks but then you have to keep your AD and SQL data in sync. – Pondlife Feb 07 '13 at 13:32

1 Answers1

0

You could store the information using a hierachyid to keep the relationships between managers and users.

See this tutorial for details, there a loads of other examples too:

Tutorial: Using the hierachyid data type

steoleary
  • 8,968
  • 2
  • 33
  • 47