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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.