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

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.