Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exchange 2010 mass change alias?

Posted on 2011-09-02
14
Medium Priority
?
1,025 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
Does Powershell have you tied up in knots?

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
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
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

610 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