Category Archives: 17468

How to delete duplicate Lync Contacts or Lync Contacts folders

A bug in previous versions of the Lync 2013 client caused Lync contacts to be duplicated in the Exchange Lync Clients folder. This makes it very annoying to work with contacts in Outlook, OWA, and mobile devices.

I wrote in an earlier article, Fix for Excessive Duplicate Contacts, that describes how to delete these contacts or folders using OWA or earlier versions of Outlook. This was possible because these older versions did not respect the flag that defines the Lync Contacts folder as a protected folder, like Inbox or Drafts.

You could use MFCMAPI to delete protected folders, as shown below, but this can be cumbersome if you have to do it to many mailboxes — not to mention the fact that you need to grant yourself full access to the target mailbox(es).

A better solution is to have the end-users do it themselves using OWA in Light mode. OWA Light bypasses the protected folder check and allows end users to delete some or all of the Lync contacts, or the entire Lync Contacts folder itself. The best part is that this works from all versions of OWA, even Office 365!

All you need to do is send a URL to the end-users to login to OWA Light with the steps to delete the folder or contacts:

Replace with your organization’s OWA FQDN, if necessary. By following this specially crafted URL, users can enter OWA Light to clean it up without affecting their current OWA Premium experience.

From OWA Light select the Contacts folder on the left pane. To delete the duplicate Lync Contacts folder click the link for Manage Contacts Folders, then click the Choose folder to delete drop down list and delete the duplicate folder.

If the user wants to delete Lync contacts from an existing folder, select the Lync Contacts folder and use the checkboxes to select them or use the checkbox at the top to select all the contacts displayed. Then click Delete.

Hopefully this will help those of you who were unable to delete these duplicates because you were running a newer version of Outlook 2013 or OWA. Special thanks to Greyson Mitchem for the tip.

A Photo by Any Other Name…

Active Directory is directory service based on X.500 directory services, which has been around since the 1980s. Lightweight Directory Access Protocol (LDAP) is an application protocol created to query X.500 directory services, and it still functions today as a method to query Active Directory.  
A lot of the attributes that are found in Active Directory were carried over from X.500 directory services (for example, commonName, manager, and photo), but some were not.  I particularly lament the fact that AD did not implement the favouriteDrink attribute.
Active Directory’s schema includes some “new” attributes that did not exist in the X.500 implementation. For example, AD added the jpegPhoto and thumbnailPhoto attributes in addition to the photo attribute. All of this begs the question, “What’s the difference and how do Microsoft products use them?”
  • thumbnailPhoto is single valued, stores the photo using the JPEG File Interchange Format, and has a upper-Range of 102,400 bytes (100 KB).

  • jpegPhoto is multivalued, stores photos using the JPEG File Interchange Format, and doesn’t enforce an upper-Range.
  • photo is multivalued, stores photos encoded in G3 fax format, and doesn’t enforce an upper-Range.

Does Exchange 2013 automatically import or reference a
user’s thumbnailPhoto attribute from AD if it is populate
d?  Yes, it’s fairly well documented in the article, GAL Photos in Exchange 2010 and Outlook 2010.  As I wrote in my article, Working with Hi-Res Photos in Exchange 2013 and Lync 2013, Exchange 2013 now goes to eleven by storing hi-res photos in the user’s mailbox, as well, but this requires Outlook 2013 or Lync 2013 to view it.  Lower level clients still use thumbnailPhoto.

If you upload a photo to Exchange 2013, does that write back
to thumbnailPhoto in AD?
  Yes, see same articles for more detail.

Does the “photo” attribute in AD get used at all? Ever? Not by Exchange, Lync or SharePoint. The fact that it uses G3 fax encoding (do any of you kids even know what a G3 fax is?) makes it pretty much useless for modern day computing needs, but who knows what the NSA is doing with it.

Thanks to my colleague and fellow Lync MCM, Greyson Mitchem, for the great questions and blog suggestion.

Fix for Excessive Duplicate Contacts

If you’re running Lync in your environment you may notice that you have multiple duplicate contacts in your contacts list.

This issue also affects your ActiveSync mobile devices, such as the iPhone.

If you open one of these duplicate contacts, you will notice that the Notes field says the contact was added by Lync 2013.

This a caused by a bug in the Lync client, which adds a duplicate contact item every time you have do an IM with this contact.  The bug will be fixed in the next cumulative update (CU) for the Lync 2013 client.  In the meantime, here’s how you can fix it.
The duplicate contacts are stored in a contacts folder called Lync Contacts.  This folder is protected by Outlook so you can’t delete it from there.  You need to delete it from Outlook Web App, which does not treat it as protected.

  • Log into OWA and view your contacts.
  • Right-click the Lync Contacts folder and select Delete.
  • Click Yes to confirm you want to delete the selected folder and move all contents into the Deleted Items folder.  You can then sign out of OWA.
  • From the Outlook client you’ll need to empty your Deleted Items folder to finish getting rid of all the duplicate contacts.  You’ll then be free of them!

Fixing TEL links with Lync 2013 on Windows 8 with Chrome

If you run both Lync 2013 and Chrome on Windows 8 you will find that TEL links open with Chrome instead of the Lync client.  TEL links are hyperlinks used by Lync for one-click dialing.  For example: tel:14155551212

Here’s how to fix it:

  • Open an elevated CMD prompt and run the following command:

reg add “HKLM\Software\Microsoft\Office\15.0\Lync\Capabilities\URLAssociations” /v TEL /d “callto”

  • Now you are able to change the TEL protocol association to Lync 2013.  Press the Windows key and type “Default Programs” to open the Default Programs utility.  Then click “Associate a file or protocol with a program.”

  • Scroll to the bottom of the list and select TEL under the Protocols section.  

  • Click the Change Program button and set Lync (desktop) as the default program.  You will now see that Lync is the default program for the Tel protocol.

  • Click the Close button and close the Default Programs utility.

Now Lync 2013 will open when you click a TEL link in Outlook or from a web page.

Lync 2013 CU1 Released – With a Nice Surprise!

Lync 2013 Cumulative Update 1 (CU1) was released today and it includes a nice surprise — the ability to hide offline contacts in the contact list.

The Lync 2013 client update is comprised of two separate updates, lyncloc2013-kb2760512 and msores2013-kb2767852.  Both updates are available in x86 and x64 versions. 

Now that Lync 2013 is an Office component, the version you chose should match the version of Office 2013 you have installed.  If you try to install the x64 version of an update when you have the x86 version of Office installed, you’ll get an error:

Wrong Update Architecture

The update requires a reboot.  Once you login to Lync 2013 you can go to Options > Contact List, where you will find a new option, “Show contacts with away, offline and unknown presences in a separate group“.

Lync 2013 Options > Contact Lists

This option is defaulted to off. When you turn it on Lync 2013 creates a new dynamic group at the bottom called “Away and Offline Contacts”.  Anyone who is not available at the moment is moved to this group.  Your other groups only contain users who are online, as shown below:

If no one is online for a particular group, the group shows (0) members.  Pretty cool!

You can download the Lync 2013 CU1 updates here.

Script to Force Download of the Lync 2013 Address Book

In a previous article I wrote a script that forces Lync 2010 clients to update the Lync Server 2010 address book.

The Lync 2013 client not only changes the location where the address book is stored on the local machine, but changes the address book file name for Lync Server 2013, as well.

The script below sets the GALDownloadInitialDelay key in the registry to force the Lync client to download the address book immediately after signing in.  It then enumerates all the SIP_* sub-folders in the C:\Users\%username%\AppData\Local\Microsoft\Office\15.0\Lync folder and deletes the ABS__sipdomain.cache file which makes up the local Lync 2013 address book and the GAL*.* files that make up the local Lync 2010 address book.

@echo off
rem Check if Lync is running, exit if it is…
tasklist /fi “IMAGENAME eq lync.exe” | find “lync.exe” >nul
If %errorlevel%==0 goto LyncIsRunningError
rem Add x86 GALDownloadInitialDelay registry entry
reg add HKCU\Software\Policies\Microsoft\Communicator /v GALDownloadInitialDelay /t REG_DWORD /d 0 /f >nul
If %errorlevel%==1 goto ElevationError
rem Add WOW64 GALDownloadInitialDelay registry entry if x64
If %PROCESSOR_ARCHITECTURE%==AMD64 reg add HKCU\Software\Wow6432Node\Policies\Microsoft\Communicator /v GALDownloadInitialDelay /t REG_DWORD /d 0 /f >nul
If “%LOCALAPPDATA%”==”” Set LOCALAPPDATA=%USERPROFILE%\Local Settings\Application Data
dir “%LOCALAPPDATA%\Microsoft\Office\15.0\Lync\sip_*” /b > list.txt
FOR /F “tokens=1” %%i in (list.txt) do (
rem Delete the Lync Server 2010 address book…
If Exist “%LOCALAPPDATA%\Microsoft\Office\15.0\Lync\%%i\gal*.*” del “%LOCALAPPDATA%\Microsoft\Office\15.0\Lync\%%i\gal*.*”
rem Delete the Lync Server 2013 address book…
If Exist “%LOCALAPPDATA%\Microsoft\Office\15.0\Lync\%%i\abs*.cache” del “%LOCALAPPDATA%\Microsoft\Office\15.0\Lync\%%i\abs*.cache”
del list.txt
echo Clearing Lync 2013 Address Books…  Done!
echo Sign back into Lync 2013 to download the current address book.
goto End
echo ERROR: You must run this command from an elevated Command Prompt.
goto End
echo ERROR: You must exit Lync 2013 before running this command. Right-click the Lync icon and choose Exit.

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

Output from UpdateLync2013AddressBook.bat

Working with Hi-Res Photos in Exchange 2013 and Lync 2013

Exchange 2013 and Lync 2013 now have the ability to use high-resolution photos for users to view photos of their contacts and to make their own photos
available to others.  Usually these photos were stored as part of the user’s thumbnailPhoto
attribute in Active Directory.  The recommended resolution for photos stored in the thumbnailPhoto attribute is 96 pixels by 96 pixels.  In addition, the thumbnailPhoto attribute has a physical limit of 100KB, but Exchange 2010 and Lync 2010 impose a limit of 10KB.  This limit was imposed to reduce the size of the Active Directory database and increase replication performance.

Lync 2013 now features a larger contact photo for meeting participants.  It scales those small 96×96 pixel thumbnailPhotos up to 278×278 pixels, which results in a blurry, but still usable, photo.

96×96 pixel photo displayed in Lync 2013

The new high-res photos used by the Wave 15 products (Exchange 2013, Lync 2013, SharePoint 2013, and Office 2013) are now stored in the user’s Exchange 2013 mailbox and are accessed using Exchange Web Services (EWS).  This makes a lot of sense since Exchange is installed in almost all of these environments.  Lync 2013 now allows for photo sizes up to 648 pixels by 648 pixels – a 700% improvement!  Just look at that handsome devil!

648×648 pixel photo displayed in Lync 2013

The following script sample can be used to store a 648 by 648 pixel photo in Ken Myer’s Exchange 2013 mailbox:

$photo = ([Byte[]] $(Get-Content -Path “C:\Photos\Ken Myer.jpg” -Encoding Byte -ReadCount 0))
Set-UserPhoto -Identity kenmyer -PictureData $photo -Confirm:$False
Set-UserPhoto -Identity kenmyer -Save -Confirm:$False

Exchange 2013 automatically scales this 648×648 photo for various applications. The following examples show the same hi-res photo in Office 2013 and Lync 2013 scaled to different sizes.

Outlook 2013 contact view
My Picture option in Lync 2013

Notice in the Lync 2013 example above that there’s a button to allow users to edit or remove their picture.  That button only lights up in Lync 2013 if the user’s mailbox is hosted on an Exchange 2013 server.  There is no “self-service” way to upload pictures with Exchange 2010, although it can be done from SharePoint 2010.

But before you go updating all the photos of employees in your company with new hi-res photos, you should know a few things about backward compatibility.  The Set-UserPhoto cmdlet, which only exists in Exchange 2013 and is used in the script above, not only stores the hi-res photo in the user’s mailbox, it also stores a 48×48 pixel version in the thumbnailPhoto AD attribute.  That’s half the resolution of the 96×96 recommended size and results in a terrible photo for users on Exchange 2010.

48×48 pixel thumbnailPhoto displayed in Lync 2013

It’s interesting to note that Exchange 2010 users always use the 48×48 thumbnailPhoto attribute in AD.  Lync 2013 won’t look for a hi-res photo in the Exchange 2013 user’s mailbox if the Lync 2013 user is on Exchange 2010.  This gives a less than optimal view for the Exchange 2010 Lync user:

This is really only an issue for customers in an migration scenario, but it’s worth noting.  The point is that you should only update Exchange 2013 mailbox users with hi-res photos.

For more information about high resolution photos used in Lync 2013 see Configuring the Use of High-Resolution Photos in Microsoft Lync Server 2013, but please keep in mind that the script examples in that article have typos in them.  The script above corrects those errors.

You may also want to read GAL Photos in Exchange 2010 and Outlook 2010.

Lync 2013 and Exchange 2013 Visio Stencils

Microsoft has released a new set of Visio stencils and shapes for Lync 2013 and Exchange 2013.  You can download the new stencils here.

This stencil contains more than 300 icons to help you create visual representations of your Microsoft Office and Exchange Server architecture.

The Visio stencil provides more than 300 icons — many depicting servers, applications, and services — that you can use in architecture diagrams, charts, and posters. These icons are primarily centered around Lync, SharePoint, and Exchange technologies and features.