Usually, we need to perform an export/import of the contacts of a user for a migration purposes.

Today, someone asked me to delete a Lync account and enable a Lync Account on a new AD account and migrate the contacts from the old one to the new one.

This is something possible with the commands “Export-csUserData” and “Update-csUserData”. Don’t use the command “import-csUserData” because it will not work.

The difference between the two commands is that “import” replace while “update” just append the data (which is not a problem as the destination is new).

The process is like this :

  1. Launch the command “Export-CsUserData -PoolFQDN poolname -FileName filepath.zip -UserFilter UserSipAddress
  2. A zip is created containing the data
  3. Launch the command “Update-CsUserData -FileName filepath.zip -UserFilter UserSipAddress
  4. The contacts are now in the new Lync account

If the user also changed his SIP address, then there is an extra step where you need to edit the file called DocItem in the zip file before launching the command to update.

  1. Open the zip file created
  2. Extract the file DocItemSet.xml
  3. Open it with text editor and replace any occurence of the old SIP address with the new one then save it.
  4. Replace the file previously edited in the zip file and launch the update.