共用方式為


New-SPContentDeploymentJob

建立內容部署工作。

語法

Default (預設值)

New-SPContentDeploymentJob
    -Name <String>
    -SPContentDeploymentPath <SPContentDeploymentPathPipeBind>
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-Description <String>]
    [-EmailAddresses <String[]>]
    [-EmailNotifications <ContentDeploymentNotificationSettings>]
    [-HostingSupportEnabled]
    [-IncrementalEnabled]
    [-Schedule <String>]
    [-ScheduleEnabled]
    [-Scope <SPWebPipeBind[]>]
    [-SqlSnapshotSetting <ContentDeploymentSqlSnapshotSetting>]
    [-WhatIf]
    [<CommonParameters>]

Description

New-SPContentDeploymentJob Cmdlet 會將新的內容部署工作新增至伺服器陣列。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

Get-SPContentDeploymentPath "Path 1" | New-SPContentDeploymentJob -Name "Deployment Job" -SPContentDeploymentPath $_ -IncrementalEnabled:$true -ScheduleEnabled:$false

此範例會使用部署路徑 Path 1,來建立名為 Deployment Job 的新內容部署工作。 此工作已設定為沒有排程的累加工作。

參數

-AssignmentCollection

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。

使用 Global 參數時,所有物件會包含在全域儲存區內。 若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。

參數屬性

類型:SPAssignmentCollection
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:True
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Confirm

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

在執行命令之前,提示您確認操作。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:cf

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Description

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定內容部署工作的說明。 名稱最多可包含 4096 個英數字元。

其類型必須為有效的字串。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-EmailAddresses

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定使用者的電子郵件地址,這些都是會收到有關此 ContentDeploymentJob 物件之電子郵件通知的使用者。

其類型必須為有效之電子郵件地址的清單。

參數屬性

類型:

String[]

預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-EmailNotifications

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定如何傳送有關此 ContentDeploymentJob 物件的電子郵件通知。

其類型必須為下列其中之一:

- Never 會指定無論工作成功或失敗,都不傳送電子郵件通知。

  • SendEmailOnSuccess 指定如果內容部署作業成功,將會傳送電子郵件通知。
  • SendEmailOnFailure 指定如果內容部署作業失敗,將會傳送電子郵件通知。
  • SendEmailOnAlways 指定當作業成功或失敗時,將會傳送電子郵件通知。

參數屬性

類型:ContentDeploymentNotificationSettings
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-HostingSupportEnabled

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會啟用特殊裝載行為。 預設值為 False。

一般而言,會使用 SharePoint 管理中心網站來啟用或停用內容部署工作。 但是,在裝載的情況下,承租人管理員並沒有存取管理中心頁面的權限,而無法設定工作。 因此,當 HostingSupportEnabled 參數設定為 True 時,主控者會建立工作,好讓承租人得以從承租人管理網站啟用或停用部署工作。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-IncrementalEnabled

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定只將累加變更部署到目的地網站集合。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Name

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定新內容部署工作的名稱。

其類型必須為內容部署工作的有效名稱;例如 DeployJob1。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Schedule

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會設定部署工作的排程。

其類型必須為有效的 SPSchedule 物件。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ScheduleEnabled

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定啟用部署工作的排程。 若未啟用排程,則只能手動執行工作。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Scope

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會設定部署工作的範圍。 傳入的 SPSites 必須存在於來源網站集合的目前路徑上。 預設範圍是整個網站集合。 有效值包括 SPWeb 物件或 SPWeb 物件陣列。

此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;SharePoint Foundation 網站的有效名稱 (例如 MySPSite1) ;或有效SPWeb對象的實例。

參數屬性

類型:

SPWebPipeBind[]

預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-SPContentDeploymentPath

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

這會指定要與新部署工作相關聯的部署路徑。

其類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID、有效的內容部署工作名稱 (例如,DeployJob1),或是有效之 SPContentDeploymentJob 物件的執行個體。

參數屬性

類型:SPContentDeploymentPathPipeBind
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-SqlSnapshotSetting

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

建立來源 SharePoint Foundation 內容資料庫的資料庫快照集,以用於導出程式。

其類型必須為下列值之一:

  • CreateNew

CreateNew 值需要安裝SQL Server Enterprise Edition。

參數屬性

類型:ContentDeploymentSqlSnapshotSetting
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-WhatIf

適用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

顯示訊息會描述命令的功效而不執行命令。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:無線

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters