Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
so, I have a code that gives my details and reporting manager details when I gave my user id as input. Now I need to find the user id of my reporting manager, so that I can use his id to find his manager details. I want to display the hierarchy who are above me.

What I have tried:

This concept is new to me, i dont know where to look
Posted
Updated 10-Aug-21 23:58pm
Comments
Maciej Los 5-Aug-21 4:09am    
What have you done so far? Where are you stuck?
I'd strongly recommend to read this: Howto: (Almost) Everything In Active Directory via C#[^]

1 solution

Active Directory doesn't maintain hierarchical lists of users (who works for who). It only knows users and the group(s) those users are in.

You have to know his user name (don't use "id" - it's semantically incorrect). The best you can do is allow the user to search Active Directory by entering part of a user's name and then search Active Directory for all instances of that name, present the list to the user, and let him select the correct name.

If you wanted to save that info for future use, it's easy to do (outside of Active Directory, of course).

Go forth and code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900