Powershell - Need assistance!

hungrybeaver

Expert Member
Joined
Mar 17, 2010
Messages
2,094
Reaction score
3
Location
Durban
Software seems like the best fit for this...

In Exchange 2010 I have 900+ mail contacts. Recently I migrated from Exchange 2003 and all of these contacts now need to have their SMTP address set as their primary reply, and this somehow was lost during the migration. All the required information is in each mail contact and all I have to do it open the contact, accept a prompt, and Set As Reply on the smtp address that is already there..

This is what I have done in my powershell script which has worked on 1 user:

Code:
set-mailcontact -alias "alias" -emailaddresses 'SMTP:[email protected]'

My question is, how can I apply a similar script to a large amount of users that each have different Aliases and Different SMTP addresses? The aliases do not match the SMTP address, but ALL aliases start with debtors and then a number. eg debtors4921

I figure I could run
Code:
-alias "debtors*" -emailaddresses 'SMTP:
, but for the SMTP setting, how could I get the command to grab the SMTP information from within the specified alias?

I really don't want to manually click into each of the 900+ contacts...
 
You can do this via an Email address policy - This does it automatically for the contacts.
 
Here is what I am dealing with:

DS3vU.png


The external and SMTP are the same, but it is not primary. I would like an automated way of making the top address the 'Primary SMTP Address'. I need to apply it to a lot of contacts.
 
If I understand it correctly, your domain is like:

mydomain.co.za

you want the following to happen;
debtors2341 to change to [email protected]

if so then;

In exchange management console, do the following:

1. Under "Organization Configuration" > "Hub Transport"
Click the "E-mail Address policies"
On the right side(bar), click "New E-mail address policy"

2. Give the policy a name, debtors or something.
Click "the following specific types:"
Select "Contacts with external e-mail addresses"
Click "Next"

3. Make sure nothing is selected under "conditions" unless you want to add something.
Click on "preview", just to check it's the contacts you wish to change.
Click "next" if you are happy.

4 Click the "add" button.
Leave on "Use alias"
Specify domain "leave as your primary"


Hope this helps?
 
Top
Sign up to the MyBroadband newsletter
X