Error in Sync Server using Web Deploy PowerShell Cmdlets

Welcome Forums General PowerShell Q&A Error in Sync Server using Web Deploy PowerShell Cmdlets

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 year, 3 months ago.

  • Author
    Posts
  • #84139

    Participant
    Points: 0
    Rank: Member

    I am trying to sync two web servers using below commands (reference link)

    $src_publishing_file = Join-Path $ENV:TEMP ("{0}.publishsettings" -f $ENV:COMPUTERNAME)
    
    $dst_site='testDeployement'
    
    New-WDPublishSettings -ComputerName $ENV:COMPUTERNAME -AgentType MSDepSvc -FileName $src_publishing_file -Site $dst_site
    
    $computer='computerName'
    
    $dst_publishing_file = Join-Path $ENV:TEMP ("{0}.publishsettings" -f $computer)
    
    New-WDPublishSettings -ComputerName $computer -AgentType MSDepSvc -FileName $dst_publishing_file -Site $dst_site
    
    Sync-WDServer -SourcePublishSettings $src_publishing_file -DestinationPublishSettings $dst_publishing_file
    

    I am getting below error, and I don't know why its not working (however normal Copy-Item command is working fine).

    Sync-WDServer : (11/13/2017 4:28:38 AM) An error occurred when the request was processed on the remote computer.
    Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
       at Microsoft.Web.Deployment.IAppHostConfigLocationCollection.AddLocation(String bstrLocationPath)
       at Microsoft.Web.Deployment.AppHostConfigProvider.AddChild(DeploymentObject source, Int32 position, Boolean whatIf)
       at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext)..............
    

    Please share your thoughts on this

  • #84151

    Participant
    Points: 0
    Rank: Member

    Reading the error message the first thing is to check if there's an old copy of the file on the target. Maybe do a test-path on the target and delete if its present

    • #84161

      Participant
      Points: 0
      Rank: Member

      Hi Richard,
      There is no old copy of data. And the purpose of using Sync-WDServer command it that it itself checks that and does everything.
      Regards,
      PD

The topic ‘Error in Sync Server using Web Deploy PowerShell Cmdlets’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort