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