Solved

Exchange 2010 mass change alias?

Posted on 2011-09-02
14
994 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

726 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