Solved

Exchange 2010 mass change alias?

Posted on 2011-09-02
14
951 Views
Last Modified: 2012-05-12
In exchange 2007 when you mass created mailboxes it would by default set the alias to the username (samaccount) of the user.  In exchange 2010 it grabs FirstnameLastname as the alias.

Is there a shell command that you can run to make the mass change to username?  

And I cannot set an e-mail address policy as our usernames are the first 7 of the lastname and then the first two of the first name.  John Westington would have a username of westingjo.  
0
Comment
Question by:jruskey
  • 8
  • 6
14 Comments
 
LVL 49

Expert Comment

by:Akhater
ID: 36475850
$mbxs = get-mailbox -resultsize 1

$mbxs | set-mailbox -Alias $_.SamAccountName

that should do it for one user, if it works change the -resultsize 1 in the above command to -resultsize unlimited to apply it to all
0
 
LVL 1

Author Comment

by:jruskey
ID: 36486237
Is there any way to do this for a specific OU?  I want to test it on a single OU before I mass it out.  Please let me know.  Thanks.
0
 
LVL 49

Expert Comment

by:Akhater
ID: 36486257
yea sure

change the first line to

$mbxs = Get-Mailbox -OrganizationalUnit domain.local/users (of corse change that to your ou)

0
 
LVL 1

Author Comment

by:jruskey
ID: 36488249
I get the attached error on the second line.
error.png
0
 
LVL 49

Expert Comment

by:Akhater
ID: 36488273
the is something wrong please run the first line again and then run

$mbxs

what is the result ?

0
 
LVL 49

Expert Comment

by:Akhater
ID: 36488296
sorry my bad !

the second line should be


$mbxs | set-mailbox $_.DistinguishedName -Alias $_.SamAccountName
0
 
LVL 1

Author Comment

by:jruskey
ID: 36488317
The first line works because it gives me the results of the students.  I have tried your new line and still get an error.  It is attached.
error2.png
0
Too many email signature updates to deal with?

Do you feel like you are taking up all of your time constantly visiting users’ desks to make changes to email signatures? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

 
LVL 49

Expert Comment

by:Akhater
ID: 36488336
$mbxs | % { set-mailbox $_.DistinguishedName -Alias $_.SamAccountName}
0
 
LVL 1

Author Comment

by:jruskey
ID: 36493113
That seemed to have worked perfect.  Any way now to do a mass on that OU and take out the previous alias which was there FirstnameLastname@domain.com?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 36493721
I dot get it you just changed the akias what is the request?
0
 
LVL 1

Author Comment

by:jruskey
ID: 36495383
It changed it so that they now are correct in the sense that john smith email address is smithjo@domain.com.  However, it still has a second address in there that lists johnsmith@domain.com.
0
 
LVL 49

Expert Comment

by:Akhater
ID: 36495761
Can you share a screen shot?
0
 
LVL 49

Accepted Solution

by:
Akhater earned 500 total points
ID: 36495859
oh wait you mean now the user has 2 email address and not 2 aliases right ?

if so then don't bother with it it won't show anywhere
0
 
LVL 1

Author Closing Comment

by:jruskey
ID: 36498872
Thank you for your help
0

Featured Post

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
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 basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

706 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

16 Experts available now in Live!

Get 1:1 Help Now