0

I am trying to grab a list of users and their descriptions/departments, who are in a certain AD Security Group using the following command:

Get-ADGroupMember -Identity "SecurityGroup" | select samaccountname,description,department

This query pulls usernames (samaccountname), however is leaving blanks for description and department. I have also tried all of the following:

| select-object samaccountname,description,department
| select-object -property samaccountname,description,department
| select -property samaccountname,description,department

Can anyone tell me the correct syntax for this?

Thanks

1 Answer 1

2

I needed to pipe the output into a Get-ADUser to pull the additional info.

Get-ADGroupMember -Identity "SecurityGroup" | Get-ADUser -properties samaccountname, department, description | format-table samaccountname, department, description | Out-File SecurityGroup.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .