Script to Force Download of the Lync 2010 Address Book

http://www.expta.com/2011/02/script-to-force-download-of-lync.html

You can use the Update-CsAddressBook cmdlet on the Lync server to force the server to update the address book which will take between 1 to 60 minutes (random).  If you cannot wait then make a .bat file with the following commands :

@echo off
echo Clearing Lync Address Books…
reg add HKCU\Software\Policies\Microsoft\Communicator /v GALDownloadInitialDelay /t REG_DWORD /d 0 /f
If %errorlevel%==1 goto Error
if “%LOCALAPPDATA%”==”” Set LOCALAPPDATA=%USERPROFILE%\Local Settings\Application Data
dir “%LOCALAPPDATA%\Microsoft\Communicator\sip_*” /b > list.txt
FOR /F “tokens=1” %%i in (list.txt) do del “%LOCALAPPDATA%\Microsoft\Communicator\%%i\gal*.*”
echo.
echo Sign out of Lync and sign back in to download the current address book.
goto End
:Error
echo You must run this command from an elevated Command Prompt.
echo.
:End

Save the script above as ClearLyncAddressBook.bat and run it from an elevated Command Prompt.  Then sign out and back into Lync and the address book will download immediately.