We help IT Professionals succeed at work.

Export AD group members.

nav2567
nav2567 asked
on
97 Views
Last Modified: 2017-04-16
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.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.