Windows Vista Forums

Find User Object based on Logon Name
  1. #1


    pk Guest

    Find User Object based on Logon Name

    I need to find the location of the user object in AD based on the Logon Name

    IE:
    I have:
    JDoe123 (the logon name)

    I need:
    LDAP://cn=JohnDoe,ou=users,ou=aaa,ou=bbb,ou=ccc,DC=xxx



    thanks!

      My System SpecsSystem Spec

  2. #2


    pk Guest

    RE: Find User Object based on Logon Name

    By the way - a clarification:

    i dont know what ou the object is in, so i can not assume it lives in
    ou=users,ou=aaa,ou=bbb,ou=ccc,DC=xxx

      My System SpecsSystem Spec

  3. #3


    Richard Mueller [MVP] Guest

    Re: Find User Object based on Logon Name


    "pk" <pk@newsgroup> wrote in message
    news:1F6CD335-545E-48DE-80DB-0E2E351AA177@newsgroup

    >I need to find the location of the user object in AD based on the Logon
    >Name
    >
    > IE:
    > I have:
    > JDoe123 (the logon name)
    >
    > I need:
    > LDAP://cn=JohnDoe,ou=users,ou=aaa,ou=bbb,ou=ccc,DC=xxx
    >
    > thanks!
    You can use the NameTranslate object for this. Details at this link:

    http://www.rlmueller.net/NameTranslateFAQ.htm

    #6 is a quick example to convert the "pre-Windows 2000 logon" name into the
    Distinguished Name. #16 shows how to retrieve the NetBIOS name of the
    domain, which is needed for #6 if you don't hard code the domain name.

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



      My System SpecsSystem Spec

  4. #4


    pk Guest

    Re: Find User Object based on Logon Name

    Richard,

    As usual, you are a genius! This worked perfectly.

    I want to thank you very much for your participation in this newsgroup, and
    your informative web page. I have learned sooo much from your contributions,
    and you have saved me many, many hours spinning my wheels on scripting
    challenges.

    -PK

      My System SpecsSystem Spec

Find User Object based on Logon Name problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
win 7 new to accounts help - How to Fix the Error The User ProfileService failed the logon User profile cannot be loaded inventor1984 Server General 2 24 Jan 2010
Services Fail with Error Logon failure: the user has not been granted the requested logon type at this computer. Zaz Server General 5 06 Nov 2009
Logon Failure: the user has not granted the requested logon type at this Junior Vista networking & sharing 2 26 Nov 2008
Logon failure: the user has not been granted the requested logon typeat this computer. shil .NET General 0 17 Mar 2008
need to have a web based time sheet appear at logon and logoff Skamionek Vista security 0 13 Mar 2008