This article is an excerpt from the Exchange Server 2003 to 2010 Migration Guide.
Exchange Server 2010 treats some object attributes differently than Exchange Server 2003. The most common issue that this causes is invalid aliases on mailbox users, however it can also occur for contacts and groups.
Exchange Server 2010 applies the following rules to aliases:
Valid values are: Strings formed with characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %, &, ‘, *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or more periods may be embedded in an alias, but each period should be preceded and followed by at least one of the other characters. Unicode characters from U+00A1 to U+00FF are also valid in an alias, but they will be mapped to a best-fit US-ASCII string in the e-mail address, which is generated from such an alias.
You can see which mailboxes have invalid aliases by running the following command from the Exchange Management Shell.
Get-Mailbox -resultsize unlimited | findstr "Warning"
If there are only a few mailbox users with invalid aliases you can correct them manually using Active Directory Users & Computers on an Exchange 2003 server.
However if there are a lot of mailbox users that need aliases fixed you can use a script provided by Microsoft to automatically correct them. The Fix-Alias.ps1 script is available to download here:
The Fix-Alias.ps1 script has a built in help function to explain how to use it.
[PS] C:Admin>.fix-alias.ps1 -help This script will find objects of the specified type that contain a space in the aliasIt will remove the space from the alias and update the object Both the search character and the replacement character can be changed using the advanced options Advanced Options: -Type : Used to specifiy the get- command that is run to find the objects (Mailbox,Distributiongroup,Mailcontact) -Resultsize : Used to specifiy a result size other than the default of "Unlimited" -Search : Used to specify the character / sting to search for -Replace : Used to specify the replacement character -Add : Used to provide the get- command with addtional switch options -Help : Display this help message Examples: fix-alias.ps1 -type MailContact -Search "@" -Replace "_" -add "-OrganizationalUnit 'My Ou'"
For example, to fix all of the mailbox users in the organization that have spaces in their alias, and replace them with periods, we would run this command:
[PS] C:Admin>.fix-alias.ps1 -type Mailbox -search " " -replace "."
The script will then output which objects were found and fixed.
Found Object to Fix: Alannah Shaw New Alias of Object: Alannah.Shaw Found Object to Fix: Linda Dowden New Alias of Object: Linda.Dowden Found Object to Fix: Olive Weeks New Alias of Object: Olive.Weeks
Be careful when changing mailbox user aliases. If the Exchange 2003 Recipient Policy uses the alias to generate the user’s email address then a change to the alias may result in a change in primary SMTP address. Check your Recipient Policies first before making changes to aliases using the Fix-Alias.ps1 script.
Fix-alias.PS1 script not Found !
You are my Hero too!
Paul, you’re my hero. As we get ready to move to Office 365 both your technical articles and your book have been absolutely invaluable. Thank you so much for all you do for us struggling Exchange administrators!
PF migration failed @10%.
Error:Fatal error DataValidationException has occurred.
Pingback: Fix incorrect aliases in Exchange 2010 | Nick's IT Crap
Pingback: Check for Invalid Aliases in Exchange and AD Before Migrating to Office 365 | ODDYTEE
So what would you do in this situation? I’m getting a lot of these errors for PFs that have been recovered in the past:
Found Object to Fix: XXX (229/829) (Recovered)
New Alias of Object: XXX_(229/829)_(Recovered)
The term ‘Recovered’ is not recognized as the name of a cmdlet, function, scrip
t file, or operable program. Check the spelling of the name, or if a path was i
ncluded, verify that the path is correct and try again.
At line:1 char:117
+ set-MailPublicFolder ‘neirelocation.com/Microsoft Exchange System Objects/XXX
(829)’ -alias XXX_(229/829)_(Recovered <<<< )
+ CategoryInfo : ObjectNotFound: (Recovered:String) [], CommandNo
tFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Thanks Paul. Quick question, I forgot to restart the Information Store after I created a new database where my public folder mailboxes will reside. Should I now wait until the public folder migration completes before restarting the IS service?
The Real Person!
Author Paul Cunningham acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.
It should be fine either way. The restart is mostly to allow memory allocation between all available databases. If you restart it now the move should resume afterwards.
Hey, I’m having the same issue with exchange 2010 public folder.
when ever i tried to migrate them, I get this error.
“Message : Error: Property expression “CB News” isn’t valid. Valid values are: Strings formed with characters from A to Z (uppercase or lowercase), digits
from 0 to 9, !, #, $, %, &, ‘, *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or more periods may be embedded in an alias, but each period should
be preceded and followed by at least one of the other characters. Unicode characters from U+00A1 to U+00FF are also valid in an alias, but they
will be mapped to a best-fit US-ASCII string in the e-mail address, which is generated from such an alias.”
Any idea on how can I update the alias on the public folder to remove special characters and spaces?
The Real Person!
Author Paul Cunningham acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.
A few comments above yours there is one about fixing PF aliases.
I have an environment that does not connect to the Internet and is not allowed to have files transferred to it from other networks, so I thought I’d share how I got the alias thing fixed for us. In our case, the primary issue was Distribution Groups:
$dg = Get-DistributionGroup -ResultSize unlimited | select name,alias
$dg | %{$_.alias = $_.alias -Replace “(|)”,””}
^^^ For us, the issue was parenthesis characters, so this is the RegEx I used to match against. We just replaced them all with empty strings.
$dg | %{Set-DistributionGroup $_.name -Alias $_.alias}
For whatever reason, trying to pipe this along into one command did not work. I suspect it was because of the warning that gets triggered after the Get command. Pulling the results into a variable allowed me to work with the data without the warnings.
Hi Paul,
Try to see this link: http://www.johanveldhuis.nl/tools/scripts/fix-aliasv20.ps1
a script that can fix incorrect Public Folder aliases, With this version it’s possible to search for multiple incorrect characters and replace them. Besides this chage it is possible to fix incorrect Public Folder aliases.
@Réda BOUTBCHA
Mate that’s JUST what I was looking for – thank you!!
Ditto! LIFE SAVER!
Pingback: Solucionando problemas con los Alias en una migración a Exchange Server 2010 - CiudadanoZero
I know this post is old but thought I would share one way of doing what Graeme asked you could run Start-Transcript -path “C:TempPSOutput.txt -append followed by Get-Mailbox -resultsize unlimited | findstr “Warning”. I am sure there is a better method at catching the errors and filtering but for now this does the job :). Hope this helps…..
Hi Paul,
How do I get an output file of the Get-Mailbox -resultsize unlimited | findstr “Warning”. By default it just pipes it to the screen and in my case there are way too many of them (they scroll off the screen). I cannot find way to put the results in a file which I can then provide to my client and have them fix them either using the script listed here or manually. I have tried using the Out-file parameter but that doesn’t work…well not for me. I’d imagine there has to be a way as a company may have thousands of such accounts.
I appreciate your time
Cheers!
Graeme
The Real Person!
Author Paul Cunningham acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.
Hi Graeme, yeah that findstr method is actually not a very good way of doing that, particularly in larger environments.
There’s probably some scripting that could do the trick, possibly using a try/catch but I don’t have a scenario setup to test it out.
Perhaps in your case just go through smaller batches by limiting your Get-Mailbox (eg to specific databases one at a time, or filtering by surname).
Pingback: Confluence: Infrastruktur
Pingback: Troubleshooting Exchange 2010 – Resolvendo problemas de caracteres inválidos no alias « Rodrigo Rodrigues .:. www.andersonpatricio.org
Pingback: Tweets that mention Fixing Mail-Enabled Object Aliases for Exchange Server 2010 Migration - Exchange Server Pro -- Topsy.com