query group disabled AD group members
Posted on 2014-11-05
I have been using this script to display list of users in a specified group:
Get-ADGroupMember $GroupName -Recursive | Get-ADUser -Properties * | Select sAMAccountName,givenName,SN | Export-csv "C:\ed\ps_script\list group member\w7localadm.csv" -nti
What should I add if I need to display the "Department" field of the user as well as whether or not the account is disabled in AD?