The overall process is basically the same as what Office Communications Server does, but with added flexibility of easily customizing some of the timing of the different events.  The entire process happens over time based on a number of intervals, and by default looks like this:

  1. Changes performed on Active Directory objects are automatically synchronized by the LS User Replicator once every 60 seconds.  These changes are written into the back-end SQL database for the pool as well as the rtcab database which is used by Address Book Web Query service for the Lync 2010 Mobile client.
  2. Once every 24 hours (1:30AM local server time) the LS Address Book Server will execute a synchronization pass which pulls the most recent information stored in the SQL rtc database and writes those changes into the address book files.
  3. On a randomized schedule the Lync client and Lync Phone Edition clients download any updated .lsabs and .dabs files from the Lync Server’s share to update the client’s local GalContacs.db cache file.
    Just as with OCS there are many scenarios when waiting a ‘day or so’ to see changes appear in the contact list are less than ideal, so the manual steps have been outlined in detail in this article.

Understanding the Process

The first two items on the list above are both server-side processes are are controlled individually by separate Set and Update cmdlets.  Since PowerShell cmdlets are now used for any and all configuration this means that separate command-line tools like lcscmd.exe or abserver.exe are no longer used in Lync Server.  The ‘abserver.exe –RegenUR’ command has been replaced by Update-CsUserDatabase and the ‘abserver.exe –SyncNow’ command has been replaced by Update-CsAddressBook.

    Let us first look at the User Replicator configuration, which is the process which synchronizes data between Active Directory and the Lync SQL databases.
  • Execute the Get-CsUserReplicatorConfiguration cmdlet.

PS C:\> Get-CsUserReplicatorConfiguration

Identity                  : Global
ADDomainNamingContextList : {}
ReplicationCycleInterval  : 00:01:00

The ReplicationCycleInterval value indicates the default behavior of Lync Server to search Active Directory for any changes every minute. This interval is 1 minute by default and can be customized to any value between 1 second and 24 hours.

The second half of the server-side process is controlled by the Address Book Service which pulls information from the SQL database and writes the changes to the address book files.

  • Execute the Get-CsAddressBookConfiguration cmdlet.

PS C:\> Get-CsAddressBookConfiguration


Identity                   : Global
RunTimeOfDay               : 1:30 AM
KeepDuration               : 30
SynchronizePollingInterval : 00:05:00
MaxDeltaFileSizePercentage : 20
UseNormalizationRules      : True
IgnoreGenericRules         : False
EnableFileGeneration       : True

Noteworthy here are the SynchronizePollingInterval and RunTimeofDay settings.  The default RunTimeofDay value of 1:30 AM is the same setting that OCS used and is still indicative of the one time per day that Lync Server automatically updates the address book files automatically.

The SynchronizePollingInterval is how often the abserver.exe process checks for a pending synchronization event.  Basically when the Update-CsAddressBook cmdlet is run then a ‘synchronize now‘ event is marked and the update is not actually run immediately.  The event itself happens the next time abserver looks to see if a sync event has been triggered.  This polling interval is 5 minutes by default and can be customized to any value between 5 seconds and 3 hours.

Update Servers

Because Step #1 in the process happens by default every minute then any recent changes in AD should already be imported into the SQL database.  If this is not the case or for some reason normal replication is failing then a manual process can be used to toss out the entire copy of AD information in the SQL database’s address book store and regenerate a completely new copy.  To rebuild Lync’s copy of the AD data simply use the Update-CsUserDatabase cmdlet.  Be aware that is stuff is more process intensive than the automatic delta synchronization.  This step should not be necessary under normal circumstances.

In the time it took to read the previous paragraph Lync Server should have synchronized and outstanding changes in Active Directory and Step #2 can be manually processed.

  • Execute Update-CsAddressBook to trigger the Lync Server to synchronize current Active Directory information in the SQL database into the downloadable client and device address book files. (The -verbose switch was used in the example below to display the informational text; it is not required when running the cmdlet.)

image

  • After 5 minutes check the Lync Server event log on the server for a group of LS Address Book Server event reporting the results of the update command.

image

  • The contents of the four LS Address Book Server informational events show the triggered update and the results. The number of OC delta files written” shows that 40 new contacts were created, reflecting the new user accounts previously added into Active Directory and enabled for Lync Server.

Event ID:      21005
Description:
Synchronization pass started.

Event ID:      21010
Description:
Synchronization pass completed successfully. Address Book web service backend data partition = RtcAb1

Event ID:      21056
Description:
Synchronization Pass Summary.
Sync pass completed with 11 contacts processed
Number of separate AD partitions: 1
Number of valid contacts: 11
Number of empty contacts: 0
Number of invalid contacts: 0
Number of cached photos deleted: 0
Number of stale OC files deleted: 0
Number of OC full files written: 1 with 11 total contacts
Number of OC delta files written: 8 with a total of 40 new/updated contacts and 0 deleted contacts.
Number of OC bytes written: 10,072 compressed to 7,134 bytes on disk.
Number of stale device files deleted: 0
Number of device full files written: 1 with 0 total contacts
Number of device delta files written: 11 with a total of 0 new/updated contacts and 0 deleted contacts.
Number of device bytes written: 1,657 compressed to 1,248 bytes on disk.

Event ID:      21004
Description:
Next synchronization pass will start at:
9/24/2010 1:30:00 AM

Update Clients

Just as Office Communicator has done since a later R2 hotfix, Lync also will not immediately download changes to the Address Book files when first launched, but instead wait for a random interval of time between 1 and 60 minutes.  To trigger an immediate download two steps must be taken on the client workstation.  The first step only needs to be performed once per workstation, while the second would be done each time a forced update is desired.

  • First, execute the following command from the Windows Command Prompt run as an administrator (or manually add the GalDownloadInitialDelay registry key).  Setting this value to 0 will force Lync to immediately download the address book instead of randomly selecting a time to check the server.

reg add HKLM\Software\Policies\Microsoft\Communicator /v GalDownloadInitialDelay /t REG_DWORD /d 0 /f

Take note that the there is another difference here between the Lync and Communicator clients.  For standard 32-bit operating systems the registry path below is the same regardless of the client versions (OC 2007 R2 with July 2009 update or Lync 2010 RC) but previously 64-bit operating systems running the 32-bit only OC 2007 R2 client had to have the setting created under the Wow6432Node policies key.

  • Second, exit the Lync client and manually delete the GalContacts.db and GalContacts.db.idx files from the user’s profile directory. If the .db file still exists during startup of the client then Lync may still wait for that random interval between 0 and 60 minutes before checking for changes on the server’s address book files.  By deleting the file the Lync client must download an entire new copy, forcing it to pick up any changes.

On Windows XP workstations:

%userprofile%\Local Settings\Application Data\Microsoft\Communicator\sip_<username@domain>\

On Windows Vista or Windows 7 workstations:

%userprofile%\AppData\Local\Microsoft\Communicator\sip_<username@domain>\

  • Restart the Lync client and search for any of the recently changed information, for example the Telephone Number added to this AD user account now appears for the Lync contact.

image     image

By Jeff Schertz

Site Administrator

107 thoughts on “Updating the Lync 2010 Address Book”
  1. Jeff,

    Great article. I have performed all these steps, and I still have the same issue. The Galcontacts.DB and IDX files are NOT being created on my client machines (winXP in this case)

    Any ideas?

  2. Jeff

    Nice article, however even if i use Update-CsUserDatabase cmdlet not all active directory users are synchronize to the GAL, there are still some AD users that are missing…any ideas?

    1. If those 'missing' user accounts are not SIP enabled or do not include popultaed phone number attributesthen they will not appear in the Lync address book as there is nmo functionality related to those accounts then.

      1. users that are missing in the Lync address book has the same attributes with the enabled lync users..any ideas…thanks a lot

  3. Is the Lync2010 client supported with Office 2010 64-bit on Windows 7 64-bit?

    In this configuration the client will not search the Exchange GAL, only the local Outlook Contacts.

    I’ve performed the steps detailed in this note and manually opening the GAL Status webpage from IE produces the correct result.

    Any suggestions?

  4. Good post. Do you recommend HKLM or HKCU for GalDownloadInitialDelay . I have seen it posted both ways on the blogs.

    1. Make sure you are using the correct registry key location between the 32-bit and 64-bit versions of Windows 7, you probably have the settings in the wrong place. I've run this process almost exclusively on Windows 7 workstations at this point and the screenshots are from a W7 PC.

  5. Hi Jeff- Thanks for the great article(s). I wanted to know if you have any information regarding the entire address book process for external clients. I recently added a server to my enterprise pool and removed a server from the pool. The server I removed was the first server built in my Lync implementation. Since then, external clients have not been able to download the address book files. I moved both the internal and external web sites, prior to removing the first server. Now I'm trying to check everything from the firewall ports to certificates to servers. Any info on the actual AB query/download would be greatly appreciated.

    1. Have you verified that the file share is still functional or was it lost/disconnected during the Front End server swap?

      1. Thanks so much for the reply.

        Yes, I did verify that the file share was connected and accessable. I just rant Enable-CsComputer, to repair any permissions that may have needed it.

        I do also get a "Distribution Group Service is Unavailable…" on the client, as well. I think that the error can be generated if there's a problem with the URL publication. I've checked my ISA config and everything is good. Do you have any other ideas as to which components I can check?

  6. I have read that when a Lync client starts it will sync its address list at a random interval between 1 and 60 minutes and adding the GalDownloadInitialDelay /t REG_DWORD /d 0 /f reg key will allow us to sync it immediately rather than have to wait the random interval.

    My question is, if we set the GalDownloadInitialDelay reg key to 0 which means the Lync client should be updating is Address List immediately, why do we have to delete the GalContacts.db. I guess i am confused why we need to delete the GalContacts.db. I figured that setting the reg key and simply restarting the lync client would force the update.

    Any help would be appreciated.

    Mike

    1. Hi Mike,

      Did you manage to get anywhere with this as I have the same issue. Any new users are not updating to the local copies of the Address book. If I delete the two files (galcontacts.db and .idx) then I can see all users but then any subsequently created users are not downloaded, even after ruuning and Update Address book command. I can find new usersby using their name@domain.com but not just name.

      If anyone has resolved this it would be very helpful,

      Thanks

      Paul.

  7. Great article. It help us figure out why we had many inconsistencies in address books. However, our experience was that there still were some locally cached data on the client-side that wasn't fully cleared by just deleting the Gal*.db files. We deleted all of the files in the profile directory and that took care of the inconsistencies.

  8. Hey Jeff,

    This is definitely a very helpful article…Thanks a bunch!

    I was wondering if you knew the answer to something I've been battling concerning the Address Book.

    I have clients that essentially never log out or off of the network, therefore leaving their PC's "locked" overnight each night, which means their Lync client remains logged in as well.

    For these users who remain logged into Lync for week on end, how and when does their local address book get updated? I know logging out and then back in triggers it, but I'm looking to find out what process takes places for updating Lync users who remain logged in all th time….because I have to believe that it does happen and is "supposed" to happen. We have our AB set for WebSearchandFileDownload currently.

    Can you shed some light on this for me?

    Thanks,

    B

    1. The clients will update changes to the address book files are some amount of time and are not required to sign-out. I do not know what this time interval is though as it's not configurable and is hard-coded into the client. I've heard it's roughly ~24 hours but I do not think that is an exact interval.

  9. I have the same problem as TygaB, was there any reply to this answer

    "I have clients that essentially never log out or off of the network, therefore leaving their PC's "locked" overnight each night, which means their Lync client remains logged in as well.

    For these users who remain logged into Lync for week on end, how and when does their local address book get updated? I know logging out and then back in triggers it, but I'm looking to find out what process takes places for updating Lync users who remain logged in all th time….because I have to believe that it does happen and is "supposed" to happen. We have our AB set for WebSearchandFileDownload currently.

    Can you shed some light on this for me? !

    1. The client do not need to be logged out as it will automatically check for updates. There is no configurable delay for this and it happens roughly every 24 hours but that is just an estimated value as it depends on a number of factors.

  10. Thanks for this post. Closing Lync and then deleting the GalContact.db and .idx refreshed the Lync client. The new user is now visible and can communicate.

    Why can't they (Microsoft) build something decent that just get's updates from AD of new accounts since the last refesh every time the client loads.

    1. Honestly I've never understood why a more friendly and flexible process was not developed for this. It's still cumbersome when any manual intervention is required (which can be often).

  11. What a brilliant article! Been waiting for some time to setup a Lync 2010 lab and finally achieved it after following your series of articles. I'll definetly be book marking your site and checking back regularly for updated articles.

    Well done for putting together such a fantastic resource.

  12. Address Book Server has encountered an unexpected exception.

    Exception: Unable to initialize DBOutputSink – System.Data.SqlClient.SqlException: Cannot open database "RtcAb1" requested by the login. The login failed.
    Login failed for user 'NT AUTHORITYNETWORK SERVICE'.

    why I got this error ??? Lync standard server, windows 2008 R2

    1. did you find solution to that problem? Can you write some instructions what to du.

      I’m experiencing same problem.

      Thanks in advance

  13. Hi Jeff,
    Thanks for the great article. Just had a quick question on a related topic. What specific msRTCSIP attribute does the Lync AB server look for in a user's AD account when deciding whether a user is included in the Lync Address Book?

    Aviviere

    1. The ABS service does not look at a single attribute, it looks at multiple ones. It checks to see if the the Primary SIP and/or phone number fields are populated, as well adhering to the 'msExchangeHideFromAddressLists' setting provided by the Exchange server schema.

      1. Hi Jeff,

        Are there any other attributes you know of?
        I've enabled websearchonly (note fiileddownloadwebsearchonly produces the same result), and can see users when using the search function that don't have primary SIP or phone number fields populated, and aren't hidden from the address book.
        In pilot phase at the moment, and I'm getting asked/trying to narrow down what other attributes might also be ?
        queried.
        Any ideas?

        Great articles by the way, I use them often a reference. 🙂

    1. You can use either hives to define the setting, it does not have to be in the Current User location. I typically recommend using HKLM as then any windows user that signs on the workstation will get the address book faster, but if you want to configure users individually then HKCU will work as well.

  14. I don't get the praise for this article. It seems like like a horrible kludge to a common problem. A better article would apologize profusely and point to a download that would fix what appears to must users like a very frustrating bug that must have been obvious to MS.

    1. Well for starters I didn't write the software so not sure why I would have to apologize for anything Microsoft has produced. Secondly this is not a bug as the original client behavior was to immediately download the address book which caused problems after large deployments or migrations where hundreds or thousands of users would sign-in around the same time the next morning and subsequently slam the OCS server with requests for all address book files. So the clients now select random times to prevent a flood of requests at the same time. IMO the proper approach would be to have the Lync client fall-back to using the AB Web Query process in the event that the Address Book files have not yet been requested an cached locally, but this has not been implemented thus far.

  15. Hi all,

    My Lyncshare folder is on a Netapp server and I have full control over Lyncshare folder but still no address book in the 1-WebServices-1ABFiles folder.
    Do any of you experience same problem?
    Do any of you knows if there is some issue with NetApp file structure?

    I have Lync standard edition server Only IM and presence is roles are activated.
    Lync Server and lync client is working but getting error messages on lync server event logs that
    Address Book Server has encountered an unexpected exception. With Event Id: 21046

    Folders are created under lyncshare but they are not populated with information.

    Please Help

    1. I know that the recent CU5 release has included support for DFS on the Lync share but I do not know if using SAN or NAS storage is supported for this.

  16. Jeff – the article seems to be logical to the sync issue, however when in the case of GAL look-up the request protocol is what i suspect to be the trouble. I'll try few more, and post my updates if I get a fix.

    1. You can hide individual items from the address book as well as move entire groups of Lync objects into a separate address book, see this article for more details.

  17. A little tip if you experience that specific users AD (corporate) picture isn't showing up in Lync.. Check to see if the user is hidden from Address Lists..

    The Attribute in the AD object is called: msExchHideFromAddressLists
    If this is TRUE for the user, the AB Service doesn't include this..

    Can of course also be checked with EMC and EMS:
    Get-Mailbox alias | fl HiddenFromAddressListsEnabled

    Used the C:\Program Files\Microsoft Lync Server 2010\Server\core> .\ABServer.exe -dumpFile to conclude this..

    -Jonas

  18. Deleting the galcontacts.db and galcontacts.db.idx seems to work for us, but is there a way to do this to the whole company, and easily? I don't want to have to go to 125 computers in 6 states to do it manually 🙂

    1. Nothing is provided within Lync Server for this, but any solution (scripts or third-party apps) that can access the workstation's file system and delete files would work.

  19. Hi Jeff – we have implemented the lync server standard edition. i want to know if its possible to configure lync client to search only lync enabled users on the search tab or any server configuration to merge contacts only with lync enabled users rather than all the users in AD or outlook contacts?

    thanks.
    KN

    1. You can modify which types of objects Lync will sync from AD to reduce what appears in the Address Book files, but to remove personal Outlook contacts you'd have to de-select Outlook as the Personal Information Manager option in the Lync client which would break other Outlook integration features.

  20. hi,

    I am unable see contact details for number in search results for number, can anyone suggest me how to do configurations in server so that contact details are displayed for number

  21. Good article. I find it annoying that it will only write further data to the local copy of the address book. If you change phone number at some point, everyone in the company will have that number stored and probably as default for you forever. You can then delete the local copy on each client, but if you're a big company and employees change numbers frequently due to harassment or something similar, then this approach is just not good enough. You end up having the Lync client fetching a new local copy every morning for 30 minutes, where the employees can't search for colleagues or really use Lync.
    It's amazing to me, that Microsoft has no better way of handling this. Why doesn't it both write to and delete from the local copy, so that obsolete data is removed 🙁

  22. […] The current IIS log shows the following GET entry when a default client connection is established and the Address Book is retrieved or updated. (By default the Lync client can wait up to 60 minutes to download the address book but this workstation has been configured for immediate download using the process detailed in this previous article.) […]

  23. i didn't have these files on my new computer (GalContacts.db.idx and GalContacts.db), so i coppied them from my previous computer and it worked.

  24. Great article. You would think the address book from the client side would work better than having to go to a users machine and manually deleting galcontacts. Whats everyone's opinion on this? Im even tempted to script deleting the galcontacts files before lync is open.

  25. Jeff,
    Your site has always been my first stop for problems with our Lync 2010 install. So now I come back with another issue I’m hoping you can help.
    You skipped over the Update-CsUserDatabase command in this blog. this is the part of the address book piece we are currently having issues with. We have validated LDAP connects, but when we type that command we get a “connection failed” error. Is there a way in Lync 2010 to force it to look at a specific domain controller, since we have them all over the planet? It looked like it could be done in Lync 2013, but that part of the command is not recognized by Lync 2010. This is causing one site to not have the same addresses in their address book as the other site has.

    Another thing we noticed is some of the new DCs are using IPv6, which Lync doesn’t seem to like very much.

    Thank you for any pointers or info you can send
    Mike

  26. Thanks for the port, we are facing issue where some users have outdated AB files and they are not downloading the latest files. So is it possible to update the files for all the clients from server end? I tried manually on one machine using the above steps and it works, so how can this be done for all the users.

  27. Some good info here. FYI, my skype puts the galcontacts.db and idx here:

    %userprofile%AppDataLocalMicrosoftOffice16.0Lyncsip_email.address@domain.com

  28. hi great article

    I have used the MSRTsip-groupingid field in AD to segregate the address book. I have populated the field with the GUID of the OU the users reside in. The issues I have is that the address book never gets created on the file share. I only see the default address book 0000-0000-0000-0000

  29. Hello Jeff, I have issues with Skype client, Gal contacts.db file is unable to download. OCS 2007 client is able to download .dB files however Sfb client is unable to download the Gal contacts.db file. What could be the issue. I have tried with registry changes in the local pc, still not working,We are having Lync 2010 server .

    1. If your corporate Address Book is to large then the Group Series can fail to completely download and unpack the files. IF this happens it will revert to using the Address Book Web Query service on the Lync Server, assuming that it is enabled. The GS adheres to the in-band client policy for this behavior from the server, controlled by “Set-CsClientPolicy -AddressBookAvailability”

  30. In a pinch if contacts will not sync with lync due to connection error, import outlooks Galcontacts.db and CalContacts.db.idx files into root lync directory. logoff and quit lync, and restart. Walla !

Leave a Reply to VKK Cancel reply

Your email address will not be published. Required fields are marked *