Get Organizational Unit of a sAMAccountName

This topic contains 2 replies, has 2 voices, and was last updated by  nkaretnikov 2 weeks, 6 days ago.

  • Author
    Posts
  • #80578

    nkaretnikov
    Participant

    Hello!
    Is there a way to get a place (OU) where a particular sAMAccountName is held?
    E.x. I have n.karetnikov in a domain with 100k users. I do not know which Organization Unit this userID is stored. The result of the script would be smth like "OU=users,OU=moscow_site,DC=mycompany,DC=RU"
    Is that possible at all? 🙂

  • #80581

    Jon
    Participant

    get-aduser n.karetnikov | select distinguishedname

    • #80584

      nkaretnikov
      Participant

      so simple! 🙂
      Thank you!!!

You must be logged in to reply to this topic.