none
Lync 2013 списки контактов.! RRS feed

  • Вопрос

  • Был установлен Lync 2013 ,была сформирована тестовая группа из 10 человек .Вопрос !!как передать список контактов другому пользователю или автоматически добавлять нового пользователя в кнопку НОВЫЕ.


    HELLLP!!!!!!!!!!!
    18 марта 2013 г. 7:09

Ответы

  • Решение:

    Берем пользователя с самым полным контакт листом, обычно админа, и делаем экспорт.

    Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath

    Полученный контакт лист распаковываем. Нас интересует файл DocItemSet.xml в нем хранятся группы контактов и контакты.

    Группы контактов:

    Копируем из файла DocItemSet.xml от <ContactGroups></ContactGroups>

    <ContactGroups>
      <ContactGroup Number="1" DisplayName="fg==" /> 
      <ContactGroup Number="2" DisplayName="UGlubmVkIENvbnRhY3Rz" ExternalUri="PGdyb3VwRXh0ZW5zaW9uIGdyb3VwVHlwZT0icGlubmVkR3JvdXAiPjxlbWFpbC8+PC9ncm91cEV4dGVuc2lvbj4=" /> 
      <ContactGroup Number="3" DisplayName="0KDQtdCzINCe0YLQtNC10Ls=" /> 
      <ContactGroup Number="4" DisplayName="0JjQoiDQn9GA0L7QtdC60YLRiw==" /> 
      <ContactGroup Number="5" DisplayName="0KDRg9C60L7QstC+0LTQuNGC0LXQu9C4INCg0LXQs9C40L7QvdC+0LI=" /> 
      <ContactGroup Number="6" DisplayName="0JTQuNGA0LXQutGC0L7RgNCw" /> 
      <ContactGroup Number="7" DisplayName="0JjQog==" /> 
      <ContactGroup Number="8" DisplayName="0JjQoiDQodC90LDQsdC20LXQvdC40LU=" /> 
      <ContactGroup Number="9" DisplayName="0JzQvtC90LjRgtC+0YDQuNC90LM=" /> 
      <ContactGroup Number="10" DisplayName="0J/RgNC+0LjQt9Cy0L7QtNGB0YLQstC+" /> 
      <ContactGroup Number="11" DisplayName="0KHQtdGA0L/Rg9GF0L7Qsg==" /> 
      <ContactGroup Number="12" DisplayName="0KLQtdGF0YbQtdC90YLRgA==" /> 
      <ContactGroup Number="13" DisplayName="0KPQutGA0LDQuNC90LA=" /> 
    </ContactGroups>

    Скопированные группы вставляем в переменную $replacement :

    ##########################################################################################################################
    #
    #    Name:            Update_Lync_2013_Groups.ps1    
    #    Author:         Charles Ulrich
    #    Date:            03/08/2013
    #    Description:    Script to update the Contact List for 1 or All Lync 2013 users.
    #
    #    Requirements:    1. MUST BE RUN ON LYNC SERVER - Export-CSUserData does not like Remote Shell or Implicit Remoting
    #                    2. 7-Zip must be installed - Used to manage the ZIP files from the export and needed for the import.
    #                    3. If not running under Powershell v3.0 see comments in MultipleSelectionBox function.
    #
    #
    ##########################################################################################################################
     
    # Settings
     
    #Lync Server
    $lyncpoolfqdn = "YOURLINKSERVERPOOL"
     
    #Base File Path
    $BaseFilePath = "c:\Temp"
    #7-Zip Paths
    $7ZipPath = "c:\Program Files\7-zip\7z.exe"
    $7ZipOutputDir = $BaseFilePath + "\working"
    $7ZipOutputParam = "-o" + $7ZipOutputDir
    $7ZipIncludeFiles = $7ZipOutputDir + "\*.xml"
     
    #Lync XML and ZIP file paths
    $LyncXMLFile = $7ZipOutputDir + "\DocItemSet.xml"
    $ExportFileNamePath = $BaseFilePath + "\ExportedUserData.zip"
    $UpdatedFileNamePath = $BaseFilePath + "\UpdatedUserData.zip"
     
    # replacement node with child nodes
    [xml]$replacement = @'
      <ContactGroups>
    	<ContactGroup Number="1" DisplayName="fg==" /> 
    	<ContactGroup Number="2" DisplayName="UGlubmVkIENvbnRhY3Rz" ExternalUri="PGdyb3VwRXh0ZW5zaW9uIGdyb3VwVHlwZT0icGlubmVkR3JvdXAiPjxlbWFpbC8+PC9ncm91cEV4dGVuc2lvbj4=" /> 
    	<ContactGroup Number="3" DisplayName="0KDQtdCzINCe0YLQtNC10Ls=" /> 
    	<ContactGroup Number="4" DisplayName="0JjQoiDQn9GA0L7QtdC60YLRiw==" /> 
    	<ContactGroup Number="5" DisplayName="0KDRg9C60L7QstC+0LTQuNGC0LXQu9C4INCg0LXQs9C40L7QvdC+0LI=" /> 
    	<ContactGroup Number="6" DisplayName="0JTQuNGA0LXQutGC0L7RgNCw" /> 
    	<ContactGroup Number="7" DisplayName="0JjQog==" /> 
    	<ContactGroup Number="8" DisplayName="0JjQoiDQodC90LDQsdC20LXQvdC40LU=" /> 
    	<ContactGroup Number="9" DisplayName="0JzQvtC90LjRgtC+0YDQuNC90LM=" /> 
    	<ContactGroup Number="10" DisplayName="0J/RgNC+0LjQt9Cy0L7QtNGB0YLQstC+" /> 
    	<ContactGroup Number="11" DisplayName="0KHQtdGA0L/Rg9GF0L7Qsg==" /> 
    	<ContactGroup Number="12" DisplayName="0KLQtdGF0YbQtdC90YLRgA==" /> 
    	<ContactGroup Number="13" DisplayName="0KPQutGA0LDQuNC90LA=" /> 
      </ContactGroups>
    '@
     echo $replacement
     
    Function MultipleSelectionBox ($inputarray,$prompt,$listboxtype) {
     
    # Taken from Technet - http://technet.microsoft.com/en-us/library/ff730950.aspx
    # This version has been updated to work with Powershell v3.0.
    # Had top replace $x with $Script:x throughout the function to make it work. 
    # This specifies the scope of the X variable.  Not sure why this is needed for v3.
    # http://social.technet.microsoft.com/Forums/en-SG/winserverpowershell/thread/bc95fb6c-c583-47c3-94c1-f0d3abe1fafc
     
    $Script:x = @()
     
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
     
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $prompt
    $objForm.Size = New-Object System.Drawing.Size(300,600) 
    $objForm.StartPosition = "CenterScreen"
     
    $objForm.KeyPreview = $True
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 
        {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
        }
        })
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 
        {$objForm.Close()}})
     
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,520)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
     
    $OKButton.Add_Click(
       {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
       })
     
    $objForm.Controls.Add($OKButton)
     
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,520)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
     
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = "Please make a selection from the list below:"
    $objForm.Controls.Add($objLabel) 
     
    $objListbox = New-Object System.Windows.Forms.Listbox 
    $objListbox.Location = New-Object System.Drawing.Size(10,40) 
    $objListbox.Size = New-Object System.Drawing.Size(260,20) 
     
    $objListbox.SelectionMode = $listboxtype
     
    $inputarray | ForEach-Object {[void] $objListbox.Items.Add($_)}
     
    $objListbox.Height = 470
    $objForm.Controls.Add($objListbox) 
    $objForm.Topmost = $True
     
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
     
    Return $Script:x
    }
     
     
    #Load Lync Powershell Commands
    Import-Module Lync
     
    #Who should we update
    $sora = Read-Host "Do you want to update (A)ll users or a (S)ingle user? (S or A)"
     
    If ($sora -eq "S")
        {
            # Get user to update 
            $userlist = Get-CSUser
            $user_email=MultipleSelectionBox $userlist.UserPrincipalName "Choose Lync 2013 User" "One"
             
            #Export Single Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath
        }
    Else
        {
            #Export All Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -FileName $ExportFileNamePath
        }
     
    #Extract the Exported Zip file. Requires 7-Zip
    Write-Host " "
    &$7ZipPath e $ExportFileNamePath $7ZipOutputParam
    Write-Host " "
    Write-Host " "
    $original = [xml] (Get-Content $LyncXMLFile)
     
    #Set our loop counter to 0
    $count = $original.DocItemSet.DocItem.Count + 1
     
    Write-Host "########################################################################"
     
    #Loop through all DocItem Elements and replace any with ContactGroups in them
    For ($i=0; $i -lt $count; $i++) {
            If (($original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count -gt 0)) 
                {
                    # get the target node
                     
                    Write-Host " "
                    Write-Host "Working on XML Node: " $original.DocItemSet.DocItem[$i].Name
                    Write-Host " "
                    Write-Host "Contact Groups Before: "$original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count
                    Write-Host " "
                    $inner = $original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups
                     
                    # import the replacement values
                    $new = $original.ImportNode($replacement.ContactGroups, $true)
                     
                    # replace old node with new one (replacement node)
                    $dump = $original.DocItemSet.DocItem[$i].Data.HomedResource.ReplaceChild($new, $inner)
                     
                    Write-Host "Contact Groups After: "$original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count
            }
        }
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    #Remove blank xmlns tags created by importing the node
    $original = [xml] $original.OuterXml.Replace(" xmlns=`"`"", "")
     
    # save changes (full path to file)
    $original.Save($LyncXMLFile)
     
    # create updated zip file
    & $7ZipPath a $UpdatedFileNamePath $7ZipIncludeFiles
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
    Write-Host "The XML file has been updated with the default groups."
    Write-Host " "
    Write-Host "If you want to take a look at the file its path is"
    Write-Host " "
    Write-Host $LyncXMLFile
    Write-Host " "
    Write-Host "This file will be deleted once this script has finished."
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    $sure = Read-Host "About to upload the changes to the server.  Are you sure? (Y or N)"
     
    If ($sure -eq "Y")
        {
            Write-Host " "
            Write-Host "Updating Server with the new Contact Group Settings."
            Write-Host " "
            Write-Host "The user(s) will have no Contact groups until they"
            Write-Host "log off and back on to Lync."
             
            If ($sora -eq "S")
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath -UserFilter $user_email
                }
            Else
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath
                }
            Write-Host " "
        }
    Else
        {
            Write-Host " "
            Write-Host "Update Aborted!!!!!!"
            Write-Host " "
            Write-Host "Please Come Again!  :) "
            Write-Host " "
        }
     
    Write-Host "I will clean up the files and close the window after you hit Enter."
    Write-Host " "
     
    PAUSE
     
    # Clean Up
    Remove-Item ($BaseFilePath + "\*") -recurse

    Контакты:

    Для импорта контактов надо сделать тоже самое, копируем от <Contacts> до </Contacts>

    <Contacts>
              <Contact Buddy="test@kuromaster.ru" SubscribePresence="1" Groups="1" />
              <Contact Buddy="test2@kuromaster.ru" SubscribePresence="1" Groups="1">
                <ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
              </Contact>
              <Contact Buddy="test3@kuromaster.ru" SubscribePresence="1" Groups="1">
                <ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
              </Contact>
            </Contacts>

    Так же вставляем в скрипт, в переменную $replace (ВНИМАНИЕ, скрипт импорта группы контактов имеет отличие от скрипта импорта контактов небольшое):

    ##########################################################################################################################
    #
    #    Name:            Update_Lync_2013_Groups.ps1    
    #    Author:         Charles Ulrich
    #    Date:            03/08/2013
    #    Description:    Script to update the Contact List for 1 or All Lync 2013 users.
    #
    #    Requirements:    1. MUST BE RUN ON LYNC SERVER - Export-CSUserData does not like Remote Shell or Implicit Remoting
    #                    2. 7-Zip must be installed - Used to manage the ZIP files from the export and needed for the import.
    #                    3. If not running under Powershell v3.0 see comments in MultipleSelectionBox function.
    #
    #
    ##########################################################################################################################
     
    # Settings
     
    #Lync Server
    $lyncpoolfqdn = "YOURLINKSERVERPOOL"
     
    #Base File Path
    $BaseFilePath = "c:\Temp"
    #7-Zip Paths
    $7ZipPath = "c:\Program Files\7-zip\7z.exe"
    $7ZipOutputDir = $BaseFilePath + "\working"
    $7ZipOutputParam = "-o" + $7ZipOutputDir
    $7ZipIncludeFiles = $7ZipOutputDir + "\*.xml"
     
    #Lync XML and ZIP file paths
    $LyncXMLFile = $7ZipOutputDir + "\DocItemSet.xml"
    $ExportFileNamePath = $BaseFilePath + "\ExportedUserData.zip"
    $UpdatedFileNamePath = $BaseFilePath + "\UpdatedUserData.zip"
     
    # replacement node with child nodes
    [xml]$replacement = @'
    <Contacts>
    	  <Contact Buddy="test@kuromaster.ru" SubscribePresence="1" Groups="1" />
    	  <Contact Buddy="test2@kuromaster.ru" SubscribePresence="1" Groups="1">
    		<ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
    	  </Contact>
    	  <Contact Buddy="test3@kuromaster.ru" SubscribePresence="1" Groups="1">
    		<ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
    	  </Contact>
    </Contacts>
    '@
     echo $replacement
     
    Function MultipleSelectionBox ($inputarray,$prompt,$listboxtype) {
     
    # Taken from Technet - http://technet.microsoft.com/en-us/library/ff730950.aspx
    # This version has been updated to work with Powershell v3.0.
    # Had top replace $x with $Script:x throughout the function to make it work. 
    # This specifies the scope of the X variable.  Not sure why this is needed for v3.
    # http://social.technet.microsoft.com/Forums/en-SG/winserverpowershell/thread/bc95fb6c-c583-47c3-94c1-f0d3abe1fafc
     
    $Script:x = @()
     
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
     
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $prompt
    $objForm.Size = New-Object System.Drawing.Size(300,600) 
    $objForm.StartPosition = "CenterScreen"
     
    $objForm.KeyPreview = $True
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 
        {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
        }
        })
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 
        {$objForm.Close()}})
     
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,520)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
     
    $OKButton.Add_Click(
       {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
       })
     
    $objForm.Controls.Add($OKButton)
     
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,520)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
     
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = "Please make a selection from the list below:"
    $objForm.Controls.Add($objLabel) 
     
    $objListbox = New-Object System.Windows.Forms.Listbox 
    $objListbox.Location = New-Object System.Drawing.Size(10,40) 
    $objListbox.Size = New-Object System.Drawing.Size(260,20) 
     
    $objListbox.SelectionMode = $listboxtype
     
    $inputarray | ForEach-Object {[void] $objListbox.Items.Add($_)}
     
    $objListbox.Height = 470
    $objForm.Controls.Add($objListbox) 
    $objForm.Topmost = $True
     
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
     
    Return $Script:x
    }
     
     
    #Load Lync Powershell Commands
    Import-Module Lync
     
    #Who should we update
    $sora = Read-Host "Do you want to update (A)ll users or a (S)ingle user? (S or A)"
     
    If ($sora -eq "S")
        {
            # Get user to update 
            $userlist = Get-CSUser
            $user_email=MultipleSelectionBox $userlist.UserPrincipalName "Choose Lync 2013 User" "One"
             
            #Export Single Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath
        }
    Else
        {
            #Export All Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -FileName $ExportFileNamePath
        }
     
    #Extract the Exported Zip file. Requires 7-Zip
    Write-Host " "
    &$7ZipPath e $ExportFileNamePath $7ZipOutputParam
    Write-Host " "
    Write-Host " "
    $original = [xml] (Get-Content $LyncXMLFile)
     
    #Set our loop counter to 0
    $count = $original.DocItemSet.DocItem.Count + 1
     
    Write-Host "########################################################################"
     
    #Loop through all DocItem Elements and replace any with ContactGroups in them
    For ($i=0; $i -lt $count; $i++) {
            If (($original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count -gt 0)) 
                {
                    # get the target node
                     
                    Write-Host " "
                    Write-Host "Working on XML Node: " $original.DocItemSet.DocItem[$i].Name
                    Write-Host " "
                    Write-Host "Contact Groups Before: "$original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count
                    Write-Host " "
                    $inner = $original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts
                     
                    # import the replacement values
                    $new = $original.ImportNode($replacement.Contacts, $true)
                     
                    # replace old node with new one (replacement node)
                    $dump = $original.DocItemSet.DocItem[$i].Data.HomedResource.ReplaceChild($new, $inner)
                     
                    Write-Host "Contact Groups After: "$original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count
            }
        }
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    #Remove blank xmlns tags created by importing the node
    $original = [xml] $original.OuterXml.Replace(" xmlns=`"`"", "")
     
    # save changes (full path to file)
    $original.Save($LyncXMLFile)
     
    # create updated zip file
    & $7ZipPath a $UpdatedFileNamePath $7ZipIncludeFiles
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
    Write-Host "The XML file has been updated with the default groups."
    Write-Host " "
    Write-Host "If you want to take a look at the file its path is"
    Write-Host " "
    Write-Host $LyncXMLFile
    Write-Host " "
    Write-Host "This file will be deleted once this script has finished."
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    $sure = Read-Host "About to upload the changes to the server.  Are you sure? (Y or N)"
     
    If ($sure -eq "Y")
        {
            Write-Host " "
            Write-Host "Updating Server with the new Contact Group Settings."
            Write-Host " "
            Write-Host "The user(s) will have no Contact groups until they"
            Write-Host "log off and back on to Lync."
             
            If ($sora -eq "S")
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath -UserFilter $user_email
                }
            Else
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath
                }
            Write-Host " "
        }
    Else
        {
            Write-Host " "
            Write-Host "Update Aborted!!!!!!"
            Write-Host " "
            Write-Host "Please Come Again!  :) "
            Write-Host " "
        }
     
    Write-Host "I will clean up the files and close the window after you hit Enter."
    Write-Host " "
     
    PAUSE
     
    # Clean Up
    Remove-Item ($BaseFilePath + "\*") -recurse

    Как то так.


    21 марта 2013 г. 8:03

Все ответы

  • Как копировать контакт лист другим пользователям!!

    20 марта 2013 г. 9:42
  • Добрый день!

    Вы можете экспортировать список контактов в архив, с помощью комманды:

    Export-CsUserData -PoolFqdn "atl-cs-001.litwareinc.com" -FileName "C:\Logs\ExportedUserData.zip"

    Потом, для импортирования контактов другому клиенту используйте комманду:


    Import-CsUserData -PoolFqdn "atl-cs-001.litwareinc.com" -FileName "C:\Logs\ExportedUserData.zip"

    Также посмотрите эту статью, она моэет оказаться Вам полезной.




    20 марта 2013 г. 12:50
    Модератор
  • После ввода строки

    Export-CsUserData -PoolFqdn "user.domen.local" -FileName "C:\Logs\ExportedUserData.zip"

    Выдает ошибку!

    Export-CsUserData : Не удается найти службу для пула регистратора "user.domen.local". Запустите Get-CsService -Registrar д
    ля получения списка доступных регистраторов.
    строка:1 знак:1
    + Export-CsUserData -PoolFqdn "user.domen.local" -FileName "C:\Logs\ExportedUserData. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (user.domen.local:Fqdn) [Export-CsUserData], RegistrarNotFoundException
        + FullyQualifiedErrorId : Не удается найти службу для пула регистратора "Dion.tsk.corp". Запустите Get-CsService -
       Registrar для получения списка доступных регистраторов.,Microsoft.Rtc.Management.BlobStore.ExportOcsUserStoreDataC
      mdlet


    20 марта 2013 г. 14:30
  • Так  я выгрузил ,как выгрузить конкретного пользователя?

    20 марта 2013 г. 16:13
  • ВСе выгрузил конкретного пользователя приминив Export-CsUserData -PoolFqdn "lync.domen.corp" -UserFilter user@ domen.local -FileName "C:\Logs\ExportedUserData.zip"

    Делаю импорт и ничего не загружается.

    • Предложено в качестве ответа kuromasterT 21 марта 2013 г. 7:09
    • Отменено предложение в качестве ответа kuromasterT 21 марта 2013 г. 7:09
    20 марта 2013 г. 16:27
  • Решение:

    Берем пользователя с самым полным контакт листом, обычно админа, и делаем экспорт.

    Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath

    Полученный контакт лист распаковываем. Нас интересует файл DocItemSet.xml в нем хранятся группы контактов и контакты.

    Группы контактов:

    Копируем из файла DocItemSet.xml от <ContactGroups></ContactGroups>

    <ContactGroups>
      <ContactGroup Number="1" DisplayName="fg==" /> 
      <ContactGroup Number="2" DisplayName="UGlubmVkIENvbnRhY3Rz" ExternalUri="PGdyb3VwRXh0ZW5zaW9uIGdyb3VwVHlwZT0icGlubmVkR3JvdXAiPjxlbWFpbC8+PC9ncm91cEV4dGVuc2lvbj4=" /> 
      <ContactGroup Number="3" DisplayName="0KDQtdCzINCe0YLQtNC10Ls=" /> 
      <ContactGroup Number="4" DisplayName="0JjQoiDQn9GA0L7QtdC60YLRiw==" /> 
      <ContactGroup Number="5" DisplayName="0KDRg9C60L7QstC+0LTQuNGC0LXQu9C4INCg0LXQs9C40L7QvdC+0LI=" /> 
      <ContactGroup Number="6" DisplayName="0JTQuNGA0LXQutGC0L7RgNCw" /> 
      <ContactGroup Number="7" DisplayName="0JjQog==" /> 
      <ContactGroup Number="8" DisplayName="0JjQoiDQodC90LDQsdC20LXQvdC40LU=" /> 
      <ContactGroup Number="9" DisplayName="0JzQvtC90LjRgtC+0YDQuNC90LM=" /> 
      <ContactGroup Number="10" DisplayName="0J/RgNC+0LjQt9Cy0L7QtNGB0YLQstC+" /> 
      <ContactGroup Number="11" DisplayName="0KHQtdGA0L/Rg9GF0L7Qsg==" /> 
      <ContactGroup Number="12" DisplayName="0KLQtdGF0YbQtdC90YLRgA==" /> 
      <ContactGroup Number="13" DisplayName="0KPQutGA0LDQuNC90LA=" /> 
    </ContactGroups>

    Скопированные группы вставляем в переменную $replacement :

    ##########################################################################################################################
    #
    #    Name:            Update_Lync_2013_Groups.ps1    
    #    Author:         Charles Ulrich
    #    Date:            03/08/2013
    #    Description:    Script to update the Contact List for 1 or All Lync 2013 users.
    #
    #    Requirements:    1. MUST BE RUN ON LYNC SERVER - Export-CSUserData does not like Remote Shell or Implicit Remoting
    #                    2. 7-Zip must be installed - Used to manage the ZIP files from the export and needed for the import.
    #                    3. If not running under Powershell v3.0 see comments in MultipleSelectionBox function.
    #
    #
    ##########################################################################################################################
     
    # Settings
     
    #Lync Server
    $lyncpoolfqdn = "YOURLINKSERVERPOOL"
     
    #Base File Path
    $BaseFilePath = "c:\Temp"
    #7-Zip Paths
    $7ZipPath = "c:\Program Files\7-zip\7z.exe"
    $7ZipOutputDir = $BaseFilePath + "\working"
    $7ZipOutputParam = "-o" + $7ZipOutputDir
    $7ZipIncludeFiles = $7ZipOutputDir + "\*.xml"
     
    #Lync XML and ZIP file paths
    $LyncXMLFile = $7ZipOutputDir + "\DocItemSet.xml"
    $ExportFileNamePath = $BaseFilePath + "\ExportedUserData.zip"
    $UpdatedFileNamePath = $BaseFilePath + "\UpdatedUserData.zip"
     
    # replacement node with child nodes
    [xml]$replacement = @'
      <ContactGroups>
    	<ContactGroup Number="1" DisplayName="fg==" /> 
    	<ContactGroup Number="2" DisplayName="UGlubmVkIENvbnRhY3Rz" ExternalUri="PGdyb3VwRXh0ZW5zaW9uIGdyb3VwVHlwZT0icGlubmVkR3JvdXAiPjxlbWFpbC8+PC9ncm91cEV4dGVuc2lvbj4=" /> 
    	<ContactGroup Number="3" DisplayName="0KDQtdCzINCe0YLQtNC10Ls=" /> 
    	<ContactGroup Number="4" DisplayName="0JjQoiDQn9GA0L7QtdC60YLRiw==" /> 
    	<ContactGroup Number="5" DisplayName="0KDRg9C60L7QstC+0LTQuNGC0LXQu9C4INCg0LXQs9C40L7QvdC+0LI=" /> 
    	<ContactGroup Number="6" DisplayName="0JTQuNGA0LXQutGC0L7RgNCw" /> 
    	<ContactGroup Number="7" DisplayName="0JjQog==" /> 
    	<ContactGroup Number="8" DisplayName="0JjQoiDQodC90LDQsdC20LXQvdC40LU=" /> 
    	<ContactGroup Number="9" DisplayName="0JzQvtC90LjRgtC+0YDQuNC90LM=" /> 
    	<ContactGroup Number="10" DisplayName="0J/RgNC+0LjQt9Cy0L7QtNGB0YLQstC+" /> 
    	<ContactGroup Number="11" DisplayName="0KHQtdGA0L/Rg9GF0L7Qsg==" /> 
    	<ContactGroup Number="12" DisplayName="0KLQtdGF0YbQtdC90YLRgA==" /> 
    	<ContactGroup Number="13" DisplayName="0KPQutGA0LDQuNC90LA=" /> 
      </ContactGroups>
    '@
     echo $replacement
     
    Function MultipleSelectionBox ($inputarray,$prompt,$listboxtype) {
     
    # Taken from Technet - http://technet.microsoft.com/en-us/library/ff730950.aspx
    # This version has been updated to work with Powershell v3.0.
    # Had top replace $x with $Script:x throughout the function to make it work. 
    # This specifies the scope of the X variable.  Not sure why this is needed for v3.
    # http://social.technet.microsoft.com/Forums/en-SG/winserverpowershell/thread/bc95fb6c-c583-47c3-94c1-f0d3abe1fafc
     
    $Script:x = @()
     
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
     
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $prompt
    $objForm.Size = New-Object System.Drawing.Size(300,600) 
    $objForm.StartPosition = "CenterScreen"
     
    $objForm.KeyPreview = $True
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 
        {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
        }
        })
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 
        {$objForm.Close()}})
     
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,520)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
     
    $OKButton.Add_Click(
       {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
       })
     
    $objForm.Controls.Add($OKButton)
     
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,520)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
     
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = "Please make a selection from the list below:"
    $objForm.Controls.Add($objLabel) 
     
    $objListbox = New-Object System.Windows.Forms.Listbox 
    $objListbox.Location = New-Object System.Drawing.Size(10,40) 
    $objListbox.Size = New-Object System.Drawing.Size(260,20) 
     
    $objListbox.SelectionMode = $listboxtype
     
    $inputarray | ForEach-Object {[void] $objListbox.Items.Add($_)}
     
    $objListbox.Height = 470
    $objForm.Controls.Add($objListbox) 
    $objForm.Topmost = $True
     
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
     
    Return $Script:x
    }
     
     
    #Load Lync Powershell Commands
    Import-Module Lync
     
    #Who should we update
    $sora = Read-Host "Do you want to update (A)ll users or a (S)ingle user? (S or A)"
     
    If ($sora -eq "S")
        {
            # Get user to update 
            $userlist = Get-CSUser
            $user_email=MultipleSelectionBox $userlist.UserPrincipalName "Choose Lync 2013 User" "One"
             
            #Export Single Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath
        }
    Else
        {
            #Export All Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -FileName $ExportFileNamePath
        }
     
    #Extract the Exported Zip file. Requires 7-Zip
    Write-Host " "
    &$7ZipPath e $ExportFileNamePath $7ZipOutputParam
    Write-Host " "
    Write-Host " "
    $original = [xml] (Get-Content $LyncXMLFile)
     
    #Set our loop counter to 0
    $count = $original.DocItemSet.DocItem.Count + 1
     
    Write-Host "########################################################################"
     
    #Loop through all DocItem Elements and replace any with ContactGroups in them
    For ($i=0; $i -lt $count; $i++) {
            If (($original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count -gt 0)) 
                {
                    # get the target node
                     
                    Write-Host " "
                    Write-Host "Working on XML Node: " $original.DocItemSet.DocItem[$i].Name
                    Write-Host " "
                    Write-Host "Contact Groups Before: "$original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count
                    Write-Host " "
                    $inner = $original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups
                     
                    # import the replacement values
                    $new = $original.ImportNode($replacement.ContactGroups, $true)
                     
                    # replace old node with new one (replacement node)
                    $dump = $original.DocItemSet.DocItem[$i].Data.HomedResource.ReplaceChild($new, $inner)
                     
                    Write-Host "Contact Groups After: "$original.DocItemSet.DocItem[$i].Data.HomedResource.ContactGroups.ContactGroup.Count
            }
        }
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    #Remove blank xmlns tags created by importing the node
    $original = [xml] $original.OuterXml.Replace(" xmlns=`"`"", "")
     
    # save changes (full path to file)
    $original.Save($LyncXMLFile)
     
    # create updated zip file
    & $7ZipPath a $UpdatedFileNamePath $7ZipIncludeFiles
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
    Write-Host "The XML file has been updated with the default groups."
    Write-Host " "
    Write-Host "If you want to take a look at the file its path is"
    Write-Host " "
    Write-Host $LyncXMLFile
    Write-Host " "
    Write-Host "This file will be deleted once this script has finished."
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    $sure = Read-Host "About to upload the changes to the server.  Are you sure? (Y or N)"
     
    If ($sure -eq "Y")
        {
            Write-Host " "
            Write-Host "Updating Server with the new Contact Group Settings."
            Write-Host " "
            Write-Host "The user(s) will have no Contact groups until they"
            Write-Host "log off and back on to Lync."
             
            If ($sora -eq "S")
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath -UserFilter $user_email
                }
            Else
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath
                }
            Write-Host " "
        }
    Else
        {
            Write-Host " "
            Write-Host "Update Aborted!!!!!!"
            Write-Host " "
            Write-Host "Please Come Again!  :) "
            Write-Host " "
        }
     
    Write-Host "I will clean up the files and close the window after you hit Enter."
    Write-Host " "
     
    PAUSE
     
    # Clean Up
    Remove-Item ($BaseFilePath + "\*") -recurse

    Контакты:

    Для импорта контактов надо сделать тоже самое, копируем от <Contacts> до </Contacts>

    <Contacts>
              <Contact Buddy="test@kuromaster.ru" SubscribePresence="1" Groups="1" />
              <Contact Buddy="test2@kuromaster.ru" SubscribePresence="1" Groups="1">
                <ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
              </Contact>
              <Contact Buddy="test3@kuromaster.ru" SubscribePresence="1" Groups="1">
                <ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
              </Contact>
            </Contacts>

    Так же вставляем в скрипт, в переменную $replace (ВНИМАНИЕ, скрипт импорта группы контактов имеет отличие от скрипта импорта контактов небольшое):

    ##########################################################################################################################
    #
    #    Name:            Update_Lync_2013_Groups.ps1    
    #    Author:         Charles Ulrich
    #    Date:            03/08/2013
    #    Description:    Script to update the Contact List for 1 or All Lync 2013 users.
    #
    #    Requirements:    1. MUST BE RUN ON LYNC SERVER - Export-CSUserData does not like Remote Shell or Implicit Remoting
    #                    2. 7-Zip must be installed - Used to manage the ZIP files from the export and needed for the import.
    #                    3. If not running under Powershell v3.0 see comments in MultipleSelectionBox function.
    #
    #
    ##########################################################################################################################
     
    # Settings
     
    #Lync Server
    $lyncpoolfqdn = "YOURLINKSERVERPOOL"
     
    #Base File Path
    $BaseFilePath = "c:\Temp"
    #7-Zip Paths
    $7ZipPath = "c:\Program Files\7-zip\7z.exe"
    $7ZipOutputDir = $BaseFilePath + "\working"
    $7ZipOutputParam = "-o" + $7ZipOutputDir
    $7ZipIncludeFiles = $7ZipOutputDir + "\*.xml"
     
    #Lync XML and ZIP file paths
    $LyncXMLFile = $7ZipOutputDir + "\DocItemSet.xml"
    $ExportFileNamePath = $BaseFilePath + "\ExportedUserData.zip"
    $UpdatedFileNamePath = $BaseFilePath + "\UpdatedUserData.zip"
     
    # replacement node with child nodes
    [xml]$replacement = @'
    <Contacts>
    	  <Contact Buddy="test@kuromaster.ru" SubscribePresence="1" Groups="1" />
    	  <Contact Buddy="test2@kuromaster.ru" SubscribePresence="1" Groups="1">
    		<ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
    	  </Contact>
    	  <Contact Buddy="test3@kuromaster.ru" SubscribePresence="1" Groups="1">
    		<ContactExtension>PGNvbnRhY3RTZXR0aW5ncz48L2NvbnRhY3RTZXR0aW5ncz4NCg==</ContactExtension>
    	  </Contact>
    </Contacts>
    '@
     echo $replacement
     
    Function MultipleSelectionBox ($inputarray,$prompt,$listboxtype) {
     
    # Taken from Technet - http://technet.microsoft.com/en-us/library/ff730950.aspx
    # This version has been updated to work with Powershell v3.0.
    # Had top replace $x with $Script:x throughout the function to make it work. 
    # This specifies the scope of the X variable.  Not sure why this is needed for v3.
    # http://social.technet.microsoft.com/Forums/en-SG/winserverpowershell/thread/bc95fb6c-c583-47c3-94c1-f0d3abe1fafc
     
    $Script:x = @()
     
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
     
    $objForm = New-Object System.Windows.Forms.Form 
    $objForm.Text = $prompt
    $objForm.Size = New-Object System.Drawing.Size(300,600) 
    $objForm.StartPosition = "CenterScreen"
     
    $objForm.KeyPreview = $True
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 
        {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
        }
        })
     
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 
        {$objForm.Close()}})
     
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,520)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
     
    $OKButton.Add_Click(
       {
            foreach ($objItem in $objListbox.SelectedItems)
                {$Script:x += $objItem}
            $objForm.Close()
       })
     
    $objForm.Controls.Add($OKButton)
     
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,520)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
     
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20) 
    $objLabel.Size = New-Object System.Drawing.Size(280,20) 
    $objLabel.Text = "Please make a selection from the list below:"
    $objForm.Controls.Add($objLabel) 
     
    $objListbox = New-Object System.Windows.Forms.Listbox 
    $objListbox.Location = New-Object System.Drawing.Size(10,40) 
    $objListbox.Size = New-Object System.Drawing.Size(260,20) 
     
    $objListbox.SelectionMode = $listboxtype
     
    $inputarray | ForEach-Object {[void] $objListbox.Items.Add($_)}
     
    $objListbox.Height = 470
    $objForm.Controls.Add($objListbox) 
    $objForm.Topmost = $True
     
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
     
    Return $Script:x
    }
     
     
    #Load Lync Powershell Commands
    Import-Module Lync
     
    #Who should we update
    $sora = Read-Host "Do you want to update (A)ll users or a (S)ingle user? (S or A)"
     
    If ($sora -eq "S")
        {
            # Get user to update 
            $userlist = Get-CSUser
            $user_email=MultipleSelectionBox $userlist.UserPrincipalName "Choose Lync 2013 User" "One"
             
            #Export Single Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath
        }
    Else
        {
            #Export All Users Data
            Export-CsUserData -PoolFqdn $lyncpoolfqdn -FileName $ExportFileNamePath
        }
     
    #Extract the Exported Zip file. Requires 7-Zip
    Write-Host " "
    &$7ZipPath e $ExportFileNamePath $7ZipOutputParam
    Write-Host " "
    Write-Host " "
    $original = [xml] (Get-Content $LyncXMLFile)
     
    #Set our loop counter to 0
    $count = $original.DocItemSet.DocItem.Count + 1
     
    Write-Host "########################################################################"
     
    #Loop through all DocItem Elements and replace any with ContactGroups in them
    For ($i=0; $i -lt $count; $i++) {
            If (($original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count -gt 0)) 
                {
                    # get the target node
                     
                    Write-Host " "
                    Write-Host "Working on XML Node: " $original.DocItemSet.DocItem[$i].Name
                    Write-Host " "
                    Write-Host "Contact Groups Before: "$original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count
                    Write-Host " "
                    $inner = $original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts
                     
                    # import the replacement values
                    $new = $original.ImportNode($replacement.Contacts, $true)
                     
                    # replace old node with new one (replacement node)
                    $dump = $original.DocItemSet.DocItem[$i].Data.HomedResource.ReplaceChild($new, $inner)
                     
                    Write-Host "Contact Groups After: "$original.DocItemSet.DocItem[$i].Data.HomedResource.Contacts.Contact.Count
            }
        }
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    #Remove blank xmlns tags created by importing the node
    $original = [xml] $original.OuterXml.Replace(" xmlns=`"`"", "")
     
    # save changes (full path to file)
    $original.Save($LyncXMLFile)
     
    # create updated zip file
    & $7ZipPath a $UpdatedFileNamePath $7ZipIncludeFiles
     
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
    Write-Host "The XML file has been updated with the default groups."
    Write-Host " "
    Write-Host "If you want to take a look at the file its path is"
    Write-Host " "
    Write-Host $LyncXMLFile
    Write-Host " "
    Write-Host "This file will be deleted once this script has finished."
    Write-Host " "
    Write-Host "########################################################################"
    Write-Host " "
     
    $sure = Read-Host "About to upload the changes to the server.  Are you sure? (Y or N)"
     
    If ($sure -eq "Y")
        {
            Write-Host " "
            Write-Host "Updating Server with the new Contact Group Settings."
            Write-Host " "
            Write-Host "The user(s) will have no Contact groups until they"
            Write-Host "log off and back on to Lync."
             
            If ($sora -eq "S")
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath -UserFilter $user_email
                }
            Else
                {
                    # Update the server with the new User Data
                    Update-CsUserData -Filename $UpdatedFileNamePath
                }
            Write-Host " "
        }
    Else
        {
            Write-Host " "
            Write-Host "Update Aborted!!!!!!"
            Write-Host " "
            Write-Host "Please Come Again!  :) "
            Write-Host " "
        }
     
    Write-Host "I will clean up the files and close the window after you hit Enter."
    Write-Host " "
     
    PAUSE
     
    # Clean Up
    Remove-Item ($BaseFilePath + "\*") -recurse

    Как то так.


    21 марта 2013 г. 8:03
  • Lync 2013 с ноля, Вам удалось решить Ваш вопрос?
    26 марта 2013 г. 9:53
    Модератор
  •  Еще не пробывал!

    29 марта 2013 г. 10:32
  • kuromasterT, можно ли озвучить источник скриптов? Скрип импорта групп отрабатывает без проблем а вот с контактами уже проблема. Если делать импорт одного пользователя то он даже не вставляет в xml нужные данные. А при массовом импорте игнорирует часть пользователей.
    • Изменено pawellrus 29 апреля 2013 г. 12:05
    29 апреля 2013 г. 8:53
  • Наверное вот это:

    http://charlesulrich.blogspot.com/2013/03/lync-server-2013-bulk-updating-contact.html

    30 апреля 2013 г. 9:22
  • Поднимаю вопрос.

    Скрипт для импорта групп отрабатывает отлично, для импорта контактов -  глючит, импортирует не все и не всем. Но если все контакты распределены в группы рассылок и эти группы используются как группы контактов для Lync то достаточно обойтись распространением только групп.

    + доп вопрос по поводу экспорта

    Экспортирую контакты пользователя Export-CsUserData -PoolFqdn $lyncpoolfqdn -UserFilter $user_email -FileName $ExportFileNamePath

    и в XML файле вижу "мертвые души" 

    <Contact Buddy="IIvanov@DOMAIN.COM" SubscribePresence="1" DisplayName="" Groups="" ExternalUri=""  /><Contact Buddy="APetrov@DOMAIN.COM" SubscribePresence="1" DisplayName="" Groups="" ExternalUri=""  />
    
     
    Контакты IIvanov и APetrov уже давно не просто отключены, а удалены из AD, но при этом они отображаются в экспортном файле, хотя в контактах экспортируемого пользователя они не отображаются. Адресная книга актуальна и обновлена, как вычистить этих "мертвых душ"?