Solved

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

Posted on 2013-01-25
9
494 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
Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at 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!

 

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Read this checklist to learn more about the 15 things you should never include in an email signature.
In this video we show how to create an email address policy 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…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

919 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

21 Experts available now in Live!

Get 1:1 Help Now