Solved

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

Posted on 2009-07-16
1
266 Views
Last Modified: 2012-05-07
exchange 2007 - shell One command for adding an alias to a mailbox with multiple domains

mailbox: john.doe
domains:aaa.com, vvv.com, qqq.com, fff.com
alias: john

is there a shell one command to add the alias to all the domains that john.doe's mailbox  has??
0
Comment
Question by:whocaresaboutit
1 Comment
 
LVL 30

Accepted Solution

by:
renazonse earned 500 total points
Comment Utility
It'd be something like this:

@http://powershellcommunity.org/Forums/tabid/54/aff/3/aft/910/afv/topic/Default.aspx

$mailboxes = Get-Mailbox
foreach ($mailbox in $mailboxes)
{
$newaddress = $mailbox.samAccountname + "@secondaddress.contoso.com"
$mailbox.EmailAddresses += $newaddress
Set-Mailbox -Identity $mailbox.alias -EmailAddresses $mailbox.EmailAddresses
}

Or in combination with this:

@http://technet.microsoft.com/en-us/library/bb123794.aspx

$Temp = Get-Mailbox -Identity
$Temp.EmailAddresses.Add("smtp:john@secondaddress.contoso.com")
$Temp.EmailAddresses += ("smtp:john@thirdaddress.contoso.com")
Set-Mailbox -Instance $Temp
0

Featured Post

Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now