I recently had to put a script together that would get a set of distribution groups and its members. The built in commands of get- distributiongroup will only dump the group name and its properties, the command of get-distributionmember will only dump the members.

The following script is take in an OU path and print out the GroupName and its members.

## This script will get distrobution Groups and print out
## the Group Name and Members alias and Primary smtp address
##
## Example
## groupName: Group1
## groupsMembers:
##
## alias PrimarySmtpAddress
## —- ——————
## User.Alias USER@primarysmtpaddress

$OU=”InputHere”
##input OU path above

foreach($group in Get-DistributionGroup -OrganizationalUnit $Ou)
{
write-output “GroupName:$group “
Write-output “GroupsMembers:”
Get-DistributionGroupMember $group ft alias,primarysmtpaddress
write-output ‘ ‘

}

happy go lucky closer movie wicked lake movie poster king of new york date movie queen of spades the movie trivia never back down movie trailer my bloody valentine movie download dead like me bunny movie dark honeymoon movie genre miracle at st anna movie screenplay living hell closer movie