Getting the UserName of the Manager in Active Directory

Last post 07-07-2009 6:47 PM by FileFoundException. 2 replies.

Sort Posts:

  • Getting the UserName of the Manager in Active Directory

    07-07-2009, 2:08 AM
    • Member
      76 point Member
    • ftileh
    • Member since 10-10-2007, 12:32 PM
    • Posts 31

    Hi,

    I'm building a webservice that uses LDAP to retrieve information from active directory.

    When i use the Attribute "Manager" i get the full name of the manager of the user in AD. What i need is the username of the manager and not just the FullName.

    Is there any possibility to do so?

    Thanks

    Happy Programing
  • Re: Getting the UserName of the Manager in Active Directory

    07-07-2009, 10:29 AM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 3:49 PM
    • Posts 851

    I am assuming that you are familiar with LDAP queries and so I will skip all that (except, of course, to remind you to wrap your Searcher, etc in using statements for proper disposal <g>)

    Basically what you are going to have to do, I am afraid, is retrieve that person from AD. The nice thing is that you are given their CN, so it is a quick retrieval. Just have the PropertiesToLoad for that Searcher be their userPrincipalName and VOILA!!!

    ;)

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Getting the UserName of the Manager in Active Directory

    07-07-2009, 6:47 PM
    There are two ways to write error-free programs; only the third one works. ["Epigrams in Programming", by Alan J. Perlis]
Page 1 of 1 (3 items)