Hi @Crod ,
here is the previous example with the export to CSV:
$Users = Get-ADGroupMember -Identity MyTestGrp| ? {$_.objectclass -eq "user"}
$AllUsers = foreach ($ActiveUser in $Users)
{ Get-ADUser -Identity $Activeuser | ? {$_.enabled -eq $true} | select Name, SamAccountName, UserPrincipalName, Enabled }
$AllUsers | Export-Csv -Path C:\Temp\USers.csv -NoTypeInformation -Encoding UTF8
----------
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
Regards,
Stoyan