August 30th, 2011, 04:22 AM
Get directreports from active directory (C#)
I'm trying to get a list of the current users direct reports to then display in either a drop down list or a listbox. I don't really want to show the whole distinguished name field though, if possible either their full name or account name.
Can anyone help me with this? I've tried doing arrays and for each loops but they've not really gone anywhere so i need some help with it.
August 30th, 2011, 09:58 AM
I have been trying for a while with this code:
'sr' is the name of my search result and i just put the i < 3 in place until i can get the number of values in that attribute. But for some reason when i run this bit of code i get an error saying the index is out of range. I even get it when i put in a hard coded value of 0 instead of i, which should work as there are 4 values in that attribute.
for (int i = 0; i < 3; i++)
var dr = sr.Properties["directReports"][i].ToString();
If anyone can help it would be very appreciated
JiJi Active Directory Reports
Mr.Jymoz for these kind of problems you can use software like Active Directory Reports which i use for my purpose you can see this from the below JiJi Active Directory Reports