Adding other fields not available to Get-ADGroupMember

I am currently using the following command:

Get-ADGroupMember -Identity “ISE-EEFF-SDA-STANDARD” | Select Name,SamAccountName,DistinguishedName | Export-CSV -Path ISE-EEFF-SDA-STANDARD.csv -NoTypeInformation

I am wanting to expand it so that I also get first (givenName), and last names (SN). How would I go about doing this?

You can do a custom attribute for them.

$ADGrpMems = Get-ADGroupMember -Identity ISE-EEFF-SDA-STANDARD
$ADGrpMems | Select-Object -Property Name,SamAccountName,DistinguishedName,@{Name = "FirstName";Expression = {(Get-ADUser $_.DistinguishedName).GivenName}},@{Name = "LastName";Expression = {(Get-ADUser $_.DistinguishedName).SurName}} | Export-CSV -Path ISE-EEFF-SDA-STANDARD.csv -NoTypeInformation

Updated the above code to include the export to CSV.

why not just pipe from get-adgroupmember straight to get-aduser.

Get-ADGroupMember -Identity "ISE-EEFF-SDA-STANDARD" |get-aduser -prop givenname,surname|select name,give
nname,surname,samaccountname,Distinguishedname| Export-CSV -Path ISE-EEFF-SDA-STANDARD.csv -NoTypeInformation

Many thanks, I went with the 2nd option and it worked like a treat.