Topic Last Modified: 2007-09-24
This topic explains how to use the Exchange Management Shell to remove spaces from recipient aliases. In Microsoft Exchange Server 2003, you can create recipients with spaces in aliases. Exchange Server 2007 does not allow recipients to have spaces in their aliases.
When you try to manage a recipient with spaces in its alias using the Exchange 2007 management tools, you will experience the following issues:
If you have a mixed-mode environment with both Exchange 2003 and Exchange 2007 servers, you should remove the spaces from the aliases of your recipients.
To perform this procedure, the account you use must be delegated the following:
For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.
Run the following commands to remove the spaces from the aliases of your mailboxes. The first command locates all the mailboxes in your organization that have spaces in their aliases and stores them in the temporary variable $Mailboxes. The second command removes the spaces from the aliases of all the mailboxes stored in the temporary variable $Mailboxes.
$Mailboxes = Get-Mailbox | Where {$_.Alias -like "* *"} ForEach($Mailbox in $Mailboxes) {Set-Mailbox $Mailbox.Name -Alias:($Mailbox.Alias -Replace " ","")}
As an alternative, you can combine the two preceding commands into a single Exchange Management Shell command.
Get-Mailbox | Where {$_.Alias -like "* *"} | ForEach-Object {Set-Mailbox $_.Name -Alias:($_.Alias -Replace " ","")}
For detailed syntax and parameter information, see the Get-Mailbox and the Set-Mailbox reference topics.
To learn more about recipients in Exchange 2007, see Understanding Recipients.
For more information about managing recipients, see Managing Recipients.