Powershell - group members & attribs for multiple groups report?

Welcome Forums General PowerShell Q&A Powershell - group members & attribs for multiple groups report?

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

4 years, 7 months ago.

  • Author
  • #17467

    Points: 0
    Rank: Member


    I am trying to find a way to export the members of specific groups that I have display names of in a list. I need user attributes such as display name, email address, description, account creation date, and LastLogon.

    I want to then export the data "ideally" per group from the list into a CSV, but if not, then something that would at least put the group name that is queried in a column in the CSV so the list could be sorted easily and the viewer would be able to see the members of each group by scrolling down. One CSV per group would be best.

    Can anyone assist?


  • #17469

    Points: 24
    Team Member
    Rank: Member

    Hi Jake,

    If I were you I would search for examples in the TechNet Script Center (http://gallery.technet.microsoft.com/scriptcenter), this forum, check out http://poshlinks.com or Bing/Google. Exporting AD users and the last logon timestamp is a very common topic with a lot of examples out there.


  • #17472

    Points: 632
    Helping Hand
    Rank: Major Contributor

    Take a look at Quest Active Directory cmdlets. While this can be accomplished many ways using Get-AdGroupMember (with RSAT tools installed) or using ADSI, the Quest tools make it a one-liner because the cmdlet returns user data versus just the LDAP path of the member of the group.

    Get-QADGroupMember -Identity "Domain Admins" | Select DisplayName, Email, Description, whenCreated, LastLogon | Export-CSV C:\MyReport.csv
  • #17641

    Points: 0
    Rank: Member

    I guess you could do this. I think you need to do abit more work with this really if you want to output the group name – perhaps put the details into a hashtable and then output that?

    $group = 'Project_Name'

    Get-ADGroupMember -Identity $group | Get-ADUser -Properties name, description, Created, lastlogon, $group | ConvertTo-Csv | out-file C:\Temp\test.csv

The topic ‘Powershell - group members & attribs for multiple groups report?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort