Friday, August 16, 2013

OCS/ Lync Client address Book Update



Some time we are getting old address book in lync client, below batch script that we use when address book gets out of sync, some times user complains in our environment that he or she is not able to see new titles of the user although it is populated in outlook GAL.
1.      Exit user’s communicator.
2.      Run the following file from an admin/elevated command prompt: (Batch file)
——————————————————————————————————————
@echo off
echo Clearing 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
——————————————————————————————————————————
3.      Launch communicator and ask user to sign in.
4.      Check whether the Galcontacts.db file has been downloaded.
Galcontacts.db path:
  • ·         In XP:- C:\Documents and Settings\\Local Settings\Application Data\Microsoft\Communicator\\
  • ·         In Win 7:- C:\Users\\AppData\Local\Microsoft\ Communicator\\
5.      Run the following file from an admin/elevated command prompt:(This step is so that Gal is not downloaded everytime)
——————————————————————————————————————————
@echo off
echo Clearing Communicator Address Books…
reg delete HKCU\Software\Policies\Microsoft\Communicator /v GALDownloadInitialDelay /f
If %errorlevel%==1 goto Error
echo.
goto End
:Error
echo You must run this command from an elevated Command Prompt.
echo.
:End
——————————————————-
found on Some where on Net but modified a bit & included second batch file so that Gal is not downloaded again & again.

No comments:

Post a Comment