코드를 점차적으로 사용하여 콘텐츠 배포를 실행할 수 있습니까?
-
09-12-2019 - |
문제
코드를 사용하여 일부 콘텐츠 배포 작업을 실행하고 있지만 작업은 점진적으로 실행되지 않고 대신 모든 개체를 내보내려면 실행됩니다.아래 코드를 사용하여 점진적으로 실행할 수 있습니까?
ContentDeploymentJobCollection collection = ContentDeploymentJob.GetAllJobs();
foreach (ContentDeploymentJob job in collection)
{
job.Run(true); //run the job asynchronously
}
. 해결책
SharePoint 2007은 전체 또는 증분 작업을 선택하는 옵션을 사용하여 콘텐츠 배포를 실행하는 옵션을 제공합니다.SharePoint 2010 에서이 옵션은 중앙 관리 사이트를 통해 더 이상 사용할 수 없습니다.arround는 위의 명령을 PowerShell로 실행하는 것입니다.다음 PowerShell을 설정하여 점진적으로 실행할 컨텐츠 배포를 구성 할 수 있습니다.
$PathName = "Test Path"
$JobName = "My Job"
$IncrementalEnabled = $true
Write-Host -ForegroundColor White "- Creating content deployment job"
$CTJob = New-SPContentDeploymentJob -Name $JobName -SPContentDeploymentPath $PathName -IncrementalEnabled:$IncrementalEnabled -ScheduleEnabled:$false
.
객체 모델에서 를 사용하여 CD 작업을 호출 할 수 있습니다.
job.ExportMethod = SPExportMethodType.ExportChanges;
job.Run(true, job.LastSuccessfulDeploymentTime);
. 제휴하지 않습니다 sharepoint.stackexchange