Solved Export AD group membership and description

November 14, 2016 at 05:33:13
Specs: Windows 7
I need to export a list of all my AD security groups, their membership, and the description of the group. I have the first two with the following but I don't know enough about powershell to figure out how to add the description.

Get-ADGroup -Properties * -Filter * -SearchBase "OU=Security Groups,DC=domain,DC=com" | Foreach {
$Group = $_
Get-ADGroupMember -Id $Group | `
select @{Expression={$Group.Name};Label="Group Name"},Name | `
Export-CSV C:\Scripts\BIGroups.CSV -NoTypeInformation -append
}


See More: Export AD group membership and description

Reply ↓  Report •


#1
November 14, 2016 at 12:11:30
✔ Best Answer
Pretty sure you've got the description from your Get-ADGroup command. Just add it to your select statement, just like you do its name.

How To Ask Questions The Smart Way


Reply ↓  Report •
Related Solutions


Ask Question