?
Solved

Exchange 2010 mass change alias?

Posted on 2011-09-02
14
Medium Priority
?
1,016 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
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
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

764 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