Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag for United States of America

asked on

Export AD group members.

Hi,

I am having an issue exporting members of an AD group in the below last, firstname format:

smith, jane
dawson, ben
....

using this script.

Get-ADGroupMember -Identity "IT" |Get-ADUser -Property UserPrincipalName |Select-Object sn,givenname |Export-Csv -NoTypeInformation -Path C:\IT.csv

Please advise what should be changed.  Thanks.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial