exchange 2007 - shell One comand for multiple aliases with multiple domains

exchange 2007 - shell One command for adding an alias to a mailbox with multiple domains

mailbox: john.doe,,,
alias: john

is there a shell one command to add the alias to all the domains that john.doe's mailbox  has??
Who is Participating?
Britt ThompsonConnect With a Mentor Sr. Systems EngineerCommented:
It'd be something like this:


$mailboxes = Get-Mailbox
foreach ($mailbox in $mailboxes)
$newaddress = $mailbox.samAccountname + ""
$mailbox.EmailAddresses += $newaddress
Set-Mailbox -Identity $mailbox.alias -EmailAddresses $mailbox.EmailAddresses

Or in combination with this:


$Temp = Get-Mailbox -Identity
$Temp.EmailAddresses += ("")
Set-Mailbox -Instance $Temp
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.