Update as of October 11th, 2011: Microsoft has made a fix available through PSS. See KB2578808.
UPDATE!!! I just discovered as issue with my original SQL script to restore the default Lync ABS configuration. Thanks to this blog article for pointing out the issue and the correct way to restore the default ABS config. I have updated this article to reflect the correct procedure. If you are having issues with contact photos, please run the SQL script described below.
I was recently working on a Lync Address Book configuration with the ABSConfig.exe tool from the Lync Resource Kit Tools. I was unfortunate enough to use the “Restore defaults” button. It seems that Microsoft released this tool a little prematurely and forgot to update the code associated with this button. The button restores the default configuration for OCS and not Lync which breaks the Lync Address Book. I found out about this issue from a comment by Rob Young on the DrRez blog.
Microsoft has indicated that they are aware of the issue and a fix is forthcoming, but I did not have the luxury of waiting for the fix. The following SQL script will reset the Lync ABS settings back to Lync RTM default. Hopefully this will help someone else out of a jam if they find themselves in the same position.
Run this on the CMS database.
use rtc exec dbo.RtcDeleteAbAttributes exec dbo.RtcAddAbAttribute 1, N'givenName', 0x01400000 exec dbo.RtcAddAbAttribute 2, N'sn', 0x02400000 exec dbo.RtcAddAbAttribute 3, N'displayName', 0x03420000 exec dbo.RtcAddAbAttribute 4, N'title', 0x04000000 exec dbo.RtcAddAbAttribute 5, N'mailNickname', 0x05400000 exec dbo.RtcAddAbAttribute 6, N'company', 0x06000000 exec dbo.RtcAddAbAttribute 7, N'physicalDeliveryOfficeName', 0x07000000 exec dbo.RtcAddAbAttribute 8, N'msRTCSIP-PrimaryUserAddress', 0x08520C00 exec dbo.RtcAddAbAttribute 9, N'telephoneNumber', 0x09622800 exec dbo.RtcAddAbAttribute 10, N'homePhone', 0x0A302800 exec dbo.RtcAddAbAttribute 11, N'mobile', 0x0B622800 exec dbo.RtcAddAbAttribute 12, N'otherTelephone', 0x0C302000 exec dbo.RtcAddAbAttribute 13, N'ipPhone', 0x0D302000 exec dbo.RtcAddAbAttribute 14, N'mail', 0x0E500000 exec dbo.RtcAddAbAttribute 15, N'groupType', 0x0F010800 exec dbo.RtcAddAbAttribute 16, N'Department', 0x10000000 exec dbo.RtcAddAbAttribute 17, N'Description', 0x11000100 exec dbo.RtcAddAbAttribute 18, N'manager', 0x12040001 exec dbo.RtcAddAbAttribute 19, N'proxyAddresses', 0x00500105 exec dbo.RtcAddAbAttribute 20, N'msExchHideFromAddressLists', 0xFF000003
After running the SQL script, delete the ABS files in the pool File Share.
Run the Update-CsUserDatabase cmdlet and wait for event IDs 30024, 30027, and 30028.
Run Update-CsAddressBook cmdlet and wait for event ID 62020.
Your Lync Address Book should be back to default and contact photos should work again. You might have to manually delete the client address book files, restart the client, and wait for the new address book to download to see the results.