locked
How to get OU of an user RRS feed

  • Question

  • User-1075240889 posted
    Hi
    I wonder if there is other / faster ways to get ou of the logged in user?

    Here is what I can think of
    - authentication
    - Search with SAMAccountName=<username entered> using findOne
    - set PropertiesToLoad.Add("distinguishedName")
    - parse the OU= string from the property returned

    TIA
    Wednesday, May 25, 2005 9:21 AM

All replies

  • User1632741903 posted
    Um, what's the OU?
    Wednesday, May 25, 2005 11:00 AM
  • User1354132231 posted
    Not really.  You pretty much have it.  If you want to create another bind, you can just use the .Parent entry and then pull the 'CN' for it without string parsing.  However, it would probably be more efficient in this case to do the string parse since using .Parent causes another binding operation.

    Thursday, May 26, 2005 4:57 PM
  • User1354132231 posted
    Um, what's the OU?


    'OU' stands for 'organizational unit'. It is simply a container in Active Directory or ADAM that holds objects and can be used as a dilineation of control.

    Thursday, May 26, 2005 5:10 PM
  • User-1075240889 posted
    Thanks Ryan
    I end up parsing the ou= out of the "distinguishedName" property, and is working ok.

    By the way, I have just posted a forms authentication problem under forum "Security", wonder if you have tried forms authentication with AD using LDAP, and would also spare the time to advise on that?!
    Tuesday, June 7, 2005 6:03 AM
  • User2104673743 posted

    some questions on OUs:

    1. If there is not OU in the distinguishedName property value, is there an other way to find it? I mean, besides the "parent".

    2. Some users have the [OU] property, but not all, is this ok?

    3. Is there a way to find the OUs into the AD? all the OUs...

    Thanks.

    Friday, December 22, 2006 11:06 AM