When a Communicator 2007 R2 or Lync 2010 client is unable to synchronize address book files, manually deleting the Galcontacts.db and Galcontacts.idx helps resolve the problem. However, manually deleting the files is not a scalable solution for an organization that has more than 25 users. This article describes a script that can help you automatically delete Galcontacts.db and Galcontacts.idx files.
Author: Edwin Joseph
Publication date: December 22, 2011
Product versions: Microsoft Lync 2010 and Microsoft Office Communicator 2007 R2
In Microsoft Office Communication Server 2007 R2 and Microsoft Lync server 2010, the Address Book Service (ABServer.exe) generates two sets of files which are used by two groups of clients. For clients with sufficient local storage space, ABServer.exe generates a full address book file that contains a large set of user and contact object attributes.
This file is downloaded from server and is stored in GalContact.db file on the client by Microsoft Office Communicator 2007 R2. Sometimes, due to possible corruption in the GalContacts.db or GalContacts.Idx file, the client looks for an address book file that does not exist. This usually occurs when the Address Book Server is unable to generate an address book file for more than 3 days.
This article helps administrators delete the SIP profile on a user’s computer which in turn deletes the Galcontacts.db and Galcontacts.idx file. This may be necessary when a user has corruption issues with the Galcontacts.db and Galcontacts.idx file. The script that can be deployed using automatically applied group policy. The script can be placed on a file share so that user can execute the script on their workstation. This automated process deletes the Galcontacts.db and Galcontacts.idx files for multiple users.
Address Book Service Background
As previous discussed, in Office Communication Server 2007 R2 and Lync Server 2010, the Address Book Service (ABServer.exe) generates two sets of files used by two groups of clients. For clients with sufficient local storage space, the ABServer.exe generates a file that contains a full address book that contains a large set of user and contact object attributes. To optimize download efficiency, it also generates up to 29 delta files that contain incremental updates containing the last one day, two days, and up to 29 days’ worth of changes. These files have the *.lsabs file extension.
When Communicator and Lync clients access and successfully connect to the Address Book Service URL for the first time, the client attempts to download the latest complete address book file. On subsequent days, the client attempts to download a delta file based on the last full synchronization date. During daily client usage, this delta file is based on the previous day’s changes. If the client is offline for a day or more, it determines which delta file it must download to get up to date. For example, if the client is offline from Friday afternoon to Monday morning, it will attempt to download a delta file containing 3 days of changes. If the client is offline for more than 30 days, it must download the full address book file. The client stores this information in the local database, called GalContacts.db.
If the GalContacts.db or the GalContacts.Idx file becomes corrupted, a client may keep looking for address book file that does not exist. This may occur when the Address Book Server is unable to generate the address book file for more than three days. There are several reasons why the Address Book Service is not able to generate an address book file, ranging from Backend SQL Server connectivity issues to network share issues.
In situations when Communicator or Lync is unable to synchronize the address book files, manually deleting the Galcontacts.db and Galcontacts.idx from the users workstation helps solve the problem. However, this is not a scalable solution for large organizations. To solve this problem, I have written a script that deletes the SIP profile folder on the user’s computer which in turn deletes the Galcontacts.db and Galcontacts.idx file.
Note: When restarting Communicator or Lync after deleting the SIP profile folder, the client will attempt to download the address book file resulting in heavy bandwidth consumption.
For more information see: Address Book Server: Address Book File Download Service.
' NAME: Delete sip profile
' BY Edwin Joseph
' COMMENT: this script delete the sip profile for the user from machine
' the purpose here is delete the galcontact.db file so that communicator can download a new one
userProfile = objShell12.ExpandEnvironmentStrings("%userprofile%")
DeleteSip strUserPro 'delete user sip profile
'delete sip Profile
'the sip profile path is diffrent according to OS Type
If OSType="Windows 7" Or OSType="Windows Vista" Then
SipProfile=userProfile & "AppDataLocalMicrosoftcommunicator"
ElseIf OSType="Windows 2003" Or OSType="Windows XP" Then
SipProfile=userProfile & "Local SettingsApplication DataMicrosoftcommunicator"
'this is also to delete user sip profile
SipProfile=SipProfile & "Sip_*"
Sub DeleteSip (strSipPath)
On Error Resume Next
For i=0 To 10
For Each objDir In objFolder.SubFolders
'clear all objects
Dim objWMI, objItem, colItems
Dim OSVersion, OSName