Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Add additional SMTP address to all users in Exchange 2010 SP1

$
0
0

I am trying to find a script that will allow me to add an additional email address to everyone in the company in the format of:

firstname.lastname@domain.com

I do not want this to be the default address (so email policy won't work), and I don't want to lose the addresses already assigned to the account.

I have found a lot of questions similar to this one in the forums, and one that seems to be exactly what I want, but it might be dated as it isn't working when I save it as addaddress.ps1 and then run it from the Exchange Management Shell. 

The script I found that is supposed to to exactly what I'm looking for was found in this post:

http://social.technet.microsoft.com/Forums/en-US/bd96d066-fd45-4395-bfb5-ab907396d8a3/exchange-2007-ps-command-to-add-firstnamelastnamemydomaincom-smtp-address?forum=exchangesvrgenerallegacy

It is as follows:

get-mailbox -OrganizationalUnit "OU=Users1,DC=mydomain,DC=COM"
-resultsize unlimited | foreach {
$e=(get-mailbox $_.identity).emailaddresses
$e += ("{0}.{1}@mydomain.com" -f $_.firstname,$_.lastname)
set-mailbox $_.identity -emailaddresses $e

}

The problems is that when I try and run this, I get error that a pipeline is already executing.

Can someone help me out? 

I'm running Exchange 2010 Sp1

I tried posting this over in the Exchange forum, but someone suggested that I post it over here instead.  On that forum they kept directing me to Email Address policy (which will change the default email address).


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>