?
Solved

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

Posted on 2009-07-16
1
Medium Priority
?
324 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 30

Accepted Solution

by:
Britt Thompson earned 2000 total points
ID: 24871331
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
In this video we show how to create a Contact 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 >> Contact ta…
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
Suggested Courses

765 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