Solved

Exchange 2010 mass change alias?

Posted on 2011-09-02
14
963 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a Distribution Group 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 >>…
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…

932 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

12 Experts available now in Live!

Get 1:1 Help Now