Tag Archives: exchange 2007

Powershell – Get-DistributionGroup with all email addressess

$File = “C:\ita\groupslog.txt”
Get-DistributionGroup | select name , alias ,displayname,EmailAddresses | foreach {
“Name: “+$_.name
“Alias: “+$_.alias
“Displayname“ +$_.displayname
$_.EmailAddresses | foreach {
if($_.SmtpAddress){
“SmtpAddress: “+$_.SmtpAddress
}
}
} | out-File $File