Sunday, April 5, 2009

OCS Address Book Service Normalization

Recently I was working at a customer site where we were trying to come up with a normalization string for numbers in their AD forest that could handle the varying array of number formatting. I find this to be a common issue for many organizations with multiple people typing phone numbers into user accounts.


Some examples of these are:


780.555.1212
(780) 555-1212
780-555-1212
1 (780) 555-1212


The address book service performs a nightly scan of Active Directory and attempts to build a database of users and phone numbers. If the normalization rules in the "Company_Phone_Number_Normalization_Rules.txt" file can't normalize the numbers you will get a list of them outlined in the "Invalid_AD_Phone_Numbers.txt".


NOTE: The information in the "Company_Phone_Number_Normalization_Rules.txt" file is incorrect (yes, still in R2). The txt file suggests you rename the file to "Company_Phone_Normalization_Rules.txt" (which is missing the word "Number"). If you follow these instructions in the txt file it won't work. Just remove the word "Sample_" from the file name and don't forget to uncheck it as a read-only file.


Now, back to the Address Book Service and AD number normalization...


The 'universal' normalization rule I use is as follows:

(\d+)([\s()\-\./]+(\d+))([\s()\-\./]+(\d+))([\s()\-\./]+(\d+))?([\s()\-\./]+(\d+))?([\s()\-\./]+(\d+))?[\s]*



+1$1$3$5$7$9$11


This above normalization rule will work for just about any North American phone number someone types in. To make this easy to decipher and modify I will also remove all the text from the default file and begin with this one rule.


To test a number:
  • Open a command prompt and navigate to C:\Program Files\Microsoft Office Communications Server 2007 R2\Server\Core.
  • Type in "abserver.exe -testPhoneNorm " and view the result
If you wish to force the Address Book Service to scour AD again, type in "abserver.exe -regenUR" and "abserver.exe -syncNow". Be sure to open Event Viewer between these two commands and look for an event suggesting the system was successful.


The bottom line is that all numbers in your AD environment should be formatted as e.164 numbers (+17805551212).


Cheers!

No comments:

Post a Comment