Exchange 2007 and Spaces in the Alias field

I’ve not been able to find much documentation about this online yet, but I discovered this issue in my Exchange 2007 Migration Lab: Exchange 2007 doesn’t like spaces in the alias field of mail-enabled objects.


These spaces will cause any migration of the object into the Exchange 2007 system to fail with the following error:


WARNING: Object Exchange System Objects/Consumer

Support has been corrupted and it is in an inconsistent state. The following

validation errors have occurred:

WARNING: “Consumer Support” is not valid for Alias. 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 one of them 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 email address which is generated from such an



Before you can begin the migration of your AD objects to Exchange 2007, you must update all objects in AD to remove the space.  In my case, I opted for replacing the space with an underscore (i.e. in the above example, “Consumer Support” will become “Consumer_Support”).  This change should only affect the alias property in AD and not the display name.


I wrote the following procedure involving AD Users & Computers and Powershell to correct the issue in my environment prior to installing the Exchange 2007 Schema updates:



  • Create an AD Users & Computers search query to search all exchange-enabled objects.  Include the “Exchange Alias” filed in the column headers
  • Export this list to a tab-delimited file.
  • Open this file in Excel, change the “Exchange Alias” column header to just “Alias”, and re-save as a CSV file
  • Open Powershell
    • $mailobjects = import-csv exportedfile.csv
    • $mailboxes | Where-Object {$_.alias -match ” “} | Export-CSV bad_exchaliases.csv
    • Open in Excel, remove all columns but “Alias”
    • Duplicate the “Alias” column, name it New_Alias
    • In the duplicated column, find/replace all ” ” with “_”
    • Save CSV file
    • $badaliases = import-csv bad_exchaliases.csv
    • $cred = Get-Credential (input credentials with rights to modify all objects)
    • foreach ($object in $badaliases) {Set-QADObject -Identity $object.Alias -ObjectAttributes @{mailnickname=$object.New_Alias} -Credential $cred

Update: Found this page on TechNet:


Tracking transaction log generation per hour

I’ve been working on the Exchange 2007 Mailbox Storage Calculator for my Exchange 2007 migration project.  The spreadsheet asks for the number of logs generated per hour so it can appropriately calculate the bandwidth needed for CCR and SCR log shipping.

Below is the script I wrote to do this for me.  Simply edit it to fit your Exchange server.  Since I have mulitple servers, I wrote one for each server, editing the name of the log file to match.  Then i created a batch file that runs each script for each Exchange server and created a scheduled task to re-run once per hour every hour.

FIlename: Count-Logs-EXCHSRVRNAME.ps1

function writetolog([string]$stringtowrite=”*”)
     $datetime = (Get-Date).datetime
     Add-Content $logfile “$datetime : $stringtowrite”

#the path to the log file you want to generate containing the count of
#transaction logs
$logfilename = “C:exchserver1-logcount.log”

#Make sure the count log file exists before attempting to write to it
if (Test-Path $logfilename) {Write-Host “Log file exists.”;$logfile = $logfilename} Else {Write-Host “Creating log file $logfilename”;$logfile = New-Item $logfilename -Type file}

#Path to the transaction logs for each storage group
$sg0path = “path to logs for SG0”
$sg1path = “path to logs for SG1”
$sg2path = “path to logs for SG2”
$sg3path = “path to logs for SG3”
$sg4path = “path to logs for SG4”

#Count the log files in each path, add them together and write that to the
#count log.
$sg0count = (get-childitem $sg0path).count
$sg1count = (get-childitem $sg1path).count
$sg2count = (get-childitem $sg2path).count
$sg3count = (get-childitem $sg3path).count
$sg4count = (get-childitem $sg4path).count
$date = get-date
writetolog ($sg0count + $sg1count + $sg2count + $sg3count + sg4count)

The count log file will contain data for each hour in the following format:

Tuesday, August 11, 2009 10:00:15 AM : 121
Tuesday, August 11, 2009 11:00:17 AM : 137

Simply import these logs into Excel, massage the data as needed to get an accurate count of how many log files are generated each day.  You’ll need to calculate the difference between each line of data to know how many logs were generated since the last count was taken since the script just counts the total number of logs in the directory.  You may need to add up the number for all the log files you generate if you’re generating one for each server you have.

Don’t forget to multiply by 5 before inputing the number into the Storage Calculator spreadsheet, though!  Exchange 2007 logs are 1MB in size while Exchange 2003 logs were 5MB in size!