I needed a way to get an output of all email addresses for all users on exchange 2007
Google helped me with this
Email addresses assigned to users
Get-Mailbox | select name , alias ,EmailAddresses | foreach {
"Name: "+$_.name
"Alias: "+$_.alias
$_.EmailAddresses | foreach {
if($_.SmtpAddress){
"SmtpAddress: "+$_.SmtpAddress
}
}
write-host
}
Email addresses assigned to groups
Get-DistributionGroup | select name , alias ,EmailAddresses | foreach {
"Name: "+$_.name
"Alias: "+$_.alias
$_.EmailAddresses | foreach {
if($_.SmtpAddress){
"SmtpAddress: "+$_.SmtpAddress
}
}
write-host
}
Enjoy 🙂
« Strange things happening on Server BackupAssist Version checker Now V6 »
