By default a Lync account running in an Exchange 2013 and Lync 2013 environment will be enabled for UCS (Unified Contact Store). This means that the Lync contacts get saved in the Lync user's mailbox. In order to get a list of the contacts associated with these accounts you have to export data to a zip file with some debug Lync commands and even then the information is buried in a hard to interpret XML file. 

I had a need to validate the contacts which were getting stored in UCS for Lync users and so I came up with this script to accomplish the task. It creates a temporary directory and exports all the passed Lync users' UCS contact information then parses and returns psobjects with the contact information and cleans up the temporary files.

Here are a few small examples of what can be done:

$a = Get-LyncUCSContacts test* 
Get all ucs contact information for all lync and ucs enabled users in the environment matching the name test* 
Get-CSUser -Resultsize Unlimited | Get-LyncUCSContacts | Export-CSV -NoTypeInformation UCSContacts.csv