Solved

need assistance with a quest cmdlets script to add in a secondary alias

Posted on 2013-01-25
9
493 Views
Last Modified: 2013-01-25
is there a way to add in a secondary email address to a group of 100 accounts in a particular OU based on an input file using the quest ad cmdlets?

so for example:
the primary email address for these 3 are:
bob.smith@xyz.com
john.smith@xyz.com
joe.brown@xyz.com

and i want to add in a secondary alias to each like:
bsmith@sym.com
jsmith@sym.com
jbrown@sym.com

thx in advance!

S.
0
Comment
Question by:siber1
  • 4
  • 4
9 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 38819100
Try this..
Import-Csv Test.csv | % {
$user = Get-Mailbox $_.SMTP 
$user.emailAddresses += $_.newsmtp
Set-Mailbox $user -emailAddresses $user.emailAddresses
}

Open in new window

Sample CSV file format..
SMTP,newsmtp
bob.smith@xyz.com,bsmith@sym.com
john.smith@xyz.com,jsmith@sym.com
joe.brown@xyz.com,jbrown@sym.com

Open in new window

0
 
LVL 11

Expert Comment

by:netballi
ID: 38819167
0
 

Author Comment

by:siber1
ID: 38819182
hi Subsun, using your logic would we have to capture the full proxyAddresses string first for each user?
was hoping to avoid this and just add in the new additional smtp address. is that possible?
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38819202
The script will collect emailAddresses of user then add the new one in to the list and then set it to user mailbox..
0
 

Author Comment

by:siber1
ID: 38819245
Ok thx Subsun. I will test in the lab today to validate. can i also add in an x500 address using this logic?
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38819297
Yes.. try with
$user.emailAddresses += "X500:$($_.newsmtp)"
0
 

Author Comment

by:siber1
ID: 38819534
thx Subsun. the additional smtp +add script works perfect! thx much!

the X500 test failed w/this error:

Exception setting "EmailAddresses": "Cannot convert value "System.Object[]" to type "Microsoft.Exchange.Data.ProxyAddre
ssCollection". Error: "The address '/o=Accentus/ou=First Administrative Group/cn=Recipients/cn=2010test-123' is invalid
: "/o=myorg/ou=First Administrative Group/cn=Recipients/cn=2010test-123" isn't a valid SMTP address. The domain name
 can't contain spaces and it has to have a prefix and a suffix, such as example.com.""

here is how i have the script:

Import-Csv Test.csv | % {
$user = Get-Mailbox $_.SMTP
$user.emailAddresses += "X500:$($_.newsmtp)"
Set-Mailbox $user -emailAddresses $user.emailAddresses
}
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38819899
I think it's problem with input csv file format.. Should look like..
SMTP,newsmtp
bob.smith@xyz.com,/o=Accentus/ou=First Administrative Group/cn=Recipients/cn=2010test-123
john.smith@xyz.com,/o=Accentus/ou=First Administrative Group/cn=Recipients/cn=2010test-456
joe.brown@xyz.com,/o=Accentus/ou=First Administrative Group/cn=Recipients/cn=2010test-678

Open in new window

0
 

Author Closing Comment

by:siber1
ID: 38819950
fantastic subsun. many thanks!

S.
0

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
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…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

760 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

20 Experts available now in Live!

Get 1:1 Help Now