Invoke-SFBContacts

By | October 16, 2016

A few months ago my SIP address was changing and was looking for a way of exporting/importing my contact list. I wanted a solution to work no matter if the Lync/Skype for Business environment was on-premises, hosted or online. This led me down the path of playing with the Lync 2013 Client SDK: https://www.microsoft.com/en-ca/download/details.aspx?id=36824.

If looking at pure on-premises and you have server access, look at the Export-CSUserData cmdlet in PowerShell (http://social.technet.microsoft.com/wiki/contents/articles/25001.backing-up-and-restoring-lync-2013-contacts.aspx). But even then, I would say just grab Anthony Caragol’s Lync Contact Backup and Restore Tool (GUI): http://www.skypeadmin.com/2014/07/14/new-tool-lync-2013-backup-and-restore-tool-gui/

A few months later, I had a client that was migrating between two hosted Skype for Business environments so I combined both my export and import contact list scripts.

The script can be found on TechNet Gallery:
Script Download: Invoke-SFBContacts https://gallery.technet.microsoft.com/Invoke-SFBContacts-3b3ad2ef

The parameters for Invoke-SFBContacts.ps1 is “Export” or “Import” for the mode and “File” used for the CSV file location. The script does require PowerShell v3 or newer.

If Invoke-SFBContacts.ps1 is run without any parameters the script will default to export mode and the contact list of the currently signed in Skype for Business account will be exported to c:\temp\SFBcontacts.csv. The CSV file has three columns, Group, Key and SIP. The Key column is used as a quick way of indicating unique entries, as a sip address could be a member of multiple groups. Also at this point the export function doesn’t work with Exchange Distribution Groups.

When Importing contacts there is a known issue where importing contacts into “Other Contacts” default group will fail (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) for contacts already added elsewhere in the contact list. I’ve blogged about issues with the “Other Contacts” group prior at: http://realtimeuc.com/2015/09/move-user-to-other-contacts/. The script can run multiple times and only imports missing contacts.

A couple days ago a fellow MVP, Rodolfo Castro (https://twitter.com/ucblogmx) asked me if he could publish an exe version that used my script as an example. Of course I had no issue with this and you can find more details at: https://ucblogmx.com/2016/10/13/s4bcontactos-exportimport-contacts/.
Rodolf’s GUI looks like:
contactgui-1

Although I’m still hoping for the day that the Skype for Business client get’s a builtin Contact Manager under the Tools menu. Until then you can find my script at:
Script Download: Invoke-SFBContacts https://gallery.technet.microsoft.com/Invoke-SFBContacts-3b3ad2ef

3 thoughts on “Invoke-SFBContacts

  1. Kory Olson

    Michael,

    I have been working on a similar script that can recover contacts from a UccapiLog. I can easily modify it to import and export, but one thing that I was able to do was to successfully handle Distribution Groups. Let me know if you would like to collaborate on adding this functionality to your script.

    Reply
    1. mlamontagne Post author

      Hey Kory, hit me up on twitter @realtimeuc I’d be interested in added DG functionality.

      Reply

Leave a Comment