Powershell List AD Groups and Their Description

Simple script to output all AD groups and their description

#Geta list of AD Groups
$ADGroups = Get-ADGroup -Filter *

$ADGroupandDescription = @()

#For each groups get the description
#Use SAMAccountName as Name does not always work
foreach ($ADgroup in $ADGroups)
$ADGroupandDescription += Get-ADGroup -identity $ADgroup.SamAccountName -properties * |Select Name,Description
$ADGroupandDescription |ogv 


Leave a comment

