Script for finding a list of distinguished AD names?

Welcome Forums General PowerShell Q&A Script for finding a list of distinguished AD names?

Viewing 2 reply threads
  • Author
    Posts
    • #256733
      Participant
      Topics: 3
      Replies: 1
      Points: 40
      Rank: Member

      How would one or create a PS script that could find LDAP Distinguished Names by using a filter? For instance pulling names like below?I have a list of the Application groups in their generic format without the CN/distinguished name.  I would also need to them to be exported to a .CSV.

      CN=Application.SnowFlake.Prod.CAO_TECH.BRAND_PROTECTION.READ,OU=Portal,DC=ad,DC=blank,DC=com

      I would think get-adgroup-Filter * % {$_DistinguishedName.split. (“,”)  or something similar would work?

       

      Thanks

    • #256748
      Participant
      Topics: 16
      Replies: 1842
      Points: 3,514
      Helping Hand
      Rank: Community Hero

      You cannot filter on DistinguishedName, it’s derived at runtime. If you just have the names, you would do something like this (not tested):

      • This reply was modified 2 months, 2 weeks ago by Rob Simmers.
    • #256913
      Participant
      Topics: 13
      Replies: 15
      Points: 85
      Rank: Member
      • This reply was modified 2 months, 2 weeks ago by ImAhNoBoDy.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.