$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

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *