Skype for Business Server 2015 – Incorrect phone number displayed in contact card

Posted by: Jason Jacobs in Skype for Business

Recently, I deployed a full Skype for Business Server 2015 solution with Enterprise Voice for a customer. They already had IM & Presence on a Lync 2013 Front-End server and the plan was to migrate all users and settings to the new SfB FE, and decommission the Lync 2013 FE.


Everything went smoothly until the customer noted that the phone numbers showing in their SfB and Lync clients weren’t correct. Users would click on these “incorrect” numbers to dial a colleague and it would fail:


The interesting thing was that the incorrect numbers were an exact copy of the correct number, but with a “+” in front. For some users, both numbers were showing in the contact card.

Correct number: 07 4089 2387

Incorrect number: +07 4089 2387



My first thought was that I had messed up the normalization rules. With the help of Ken Lasko’s blog, I tweaked my rules and ended up with this:


I then did the usual steps of refreshing the Global Skype address book.

On the Front-End server:

  • Delete all files in C:\[skypefilestore]\1-WebServices-3\ABFiles\00000000-0000-0000-0000-000000000000\00000000-0000-0000-0000-000000000000\
  • > Update-CsUserDatabase
  • > Update-CsAddressBook

Then on my test PC, refresh the GAL:

  • Delete the test account Profile folder in C:\Users\jason\AppData\Local\Microsoft\Office\16.0\Lync\insynct@domain.com
  • Start-up SfB client to download the new Address book

This made no difference at all. In fact, opening the GalContacts.db file with Notepad showed the correct number. So where was the +07 coming from?

With the help of a colleague, we looked through the Exchange GAL and local Outlook address book, but found nothing.

I then looked in the SfB client log file called “Lync-UccApi-0.UccApilog” using Snooper. This log file can be found on your PC at C:\Users\username\AppData\Local\Microsoft\Office\16.0\Lync\Tracing\

In this file I searched for my incorrect number “+0740892387” and found it buried in a 200 OK response from the Front-End server. The number was then stored in the CoreContact.cache file on my client, but not in the GalContacts.db. This means that every time I searched for this user in my SfB client, it would send a SUBSCRIBE message to the FE, and I would get back a 200 OK containing this incorrect number. So clearly this number was stored someone in the FE server.


I opened a case with Microsoft support to help us with this issue. The MS tech ran the DBAnalyze.exe tool from the SfB Reskit.

C:\Program Files\Skype for Business Server 2015\ResKit\DBAnalyze.exe /report:user /user:username@domain.com /sqlserver:SFBFE01\RTCLocal  > c:\temp\SQLExports\sqlexportusername.txt

The tool grabs all data from a particular user from the Skype Database and spits it out in plain text.

In the output we could see the incorrect number showing. We could also see the “LastPubTime” was in 2015. This information told me that the incorrect number came from the old Lync 2013 server during the user migration.


Below is a script I used to check all 300+ users in SfB using the DBAnalyze.exe tool.

## Script Begin ##

$users = Get-CsUser
foreach ($user in $users) {
 $Displayname = $user.displayname
 $SamName = $user.SamAccountName
echo "Name : $Displayname"
& 'c:\Program Files\Skype for Business Server 2015\ResKit\DBAnalyze.exe' /report:user /user:$SamName@domain.com /sqlserver:SFBFE01\RTCLocal  > c:\temp\SQLExports\sqlexport$SamName.txt

## Script End ##

Finally, run the below PowerShell command to search through all the output files for the string “+074089”, and write the filenames to another TXT file called “UsersWithWrongNumbers.txt.

PS C:\temp\SQLExports> Get-ChildItem -recurse | Select-String -pattern “\+074089” | group path | select name *> C:\temp\SQLExports\UsersWithWrongNumbers.txt

Now you have a list of all user accounts having this issue. For us it was about 30 users of the 300.


I spent another few hours looking (carefully) through the RTCLOCAL instance databases on the Skype FE server using SQL Management Studio. I used some scripts to search through the tables but I could not find any references to “+0740892387”. This number is probably stored in binary format and not plain text.

The Microsoft tech was working on a solution to modify the database directly and remove these incorrect numbers.

While waiting, I had the “bright” idea to simply remove and re-add this user account from SfB.


This ended up fixing the problem for this user. By removing the account from SfB, it cleared out all contact card information for this account. Re-adding the user brought with it only the correct numbers.


I decided to do the same for all the accounts having this issue. This is much safer than manually modifying the database. If you need to backup/restore the user’s contact list or settings, make sure you run “Export-CsUserData” for each user you intend to remove/re-add.



Thanks to Hans Sleurink for his article on the Lync Address Book:


Thanks to Ken Lasko for his article on Phone Number Normalization in SfB:


Thanks to Microsoft Support for pointing me in the right direction.

Tags: , ,
Contact Us