#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    14
    Rep Power
    0

    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.

    Thanks
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    14
    Rep Power
    0
    I have been trying for a while with this code:

    Code:
                for (int i = 0; i < 3; i++)
                {
                    var dr = sr.Properties["directReports"][i].ToString();
                    ListBox1.Items.Add(dr);
                }
    '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.

    If anyone can help it would be very appreciated
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Thumbs up 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

IMN logo majestic logo threadwatch logo seochat tools logo