Get-Aduser DistinguishedName

Welcome Forums General PowerShell Q&A Get-Aduser DistinguishedName

This topic contains 2 replies, has 3 voices, and was last updated by

 
Senior Moderator
1 month, 3 weeks ago.

  • Author
    Posts
  • #168901

    Participant
    Topics: 1
    Replies: 0
    Points: 16
    Rank: Member

    Hello

     

    I have a file on my C drive I named  DistinguisheName.csv. The first column has the AD group name and is labeled "GroupName". Second column is simply named "cn". I need a script to give me the distinguished name for each of the groups in that sheet please.

    Thanks

  • #168937

    Participant
    Topics: 1
    Replies: 1530
    Points: 2,591
    Helping Hand
    Rank: Community Hero

    What have you tried so far? Please show you code and expalin what's not working as expected.

  • #169042

    Senior Moderator
    Topics: 8
    Replies: 1041
    Points: 3,440
    Helping Hand
    Rank: Community Hero

    @shawnb23 – This is of course doable. You need to use Import-Csv and Get-ADGroup cmdlet. I would suggest to read the help documentation for those cmdlets and start putting some lines of code based on what you understand. You can update this thread when you get stuck or get errors, folks here will help.

You must be logged in to reply to this topic.