Copy-SPContentTypes

指定從內部部署複寫到 SharePoint Online (SPO) 環境的內容類型。

Syntax

Copy-SPContentTypes
    [-AssignmentCollection <SPAssignmentCollection>]
    [-AuthEndpoint <String>]
    -ContentTypeNames <String[]>
    -Credential <PSCredential>
    [-GraphApiEndPoint <String>]
    -LocalSiteUrl <Uri>
    -LocalTermStoreName <String>
    -RemoteSiteUrl <Uri>
    [<CommonParameters>]

Description

此 Cmdlet 用於 SharePoint Online 的混合式案例,將內容類型從內部部署伺服器陣列複製到 SharePoint Online。

範例

範例 1

Copy-SPContentTypes -LocalSiteUrl https://localsite/ -LocalTermStoreName "managed metadata service application proxy" -RemoteSiteUrl https://contoso.sharepoint.com/ -ContentTypeNames @("ContentTypeA", "ContentTypeB") -Credential (Get-Credential)

此範例會將本機站台 https://localsite/ 上 (其字詞庫名為 Managed Metadata Service) 名為 ContentTypeA、ContentTypeB 的指定內容類型移轉至遠端站台 https://contoso.sharepoint.com/ 的中樞網站。 如果遠端站台是中樞網站台,則移轉目標將會是本身。

參數

-AssignmentCollection

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

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

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-AuthEndpoint

指定要使用的 AuthEndpoint,而非預設的一個。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-ContentTypeNames

指定要移轉的內容類型名稱。 可以是陣列形式。

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Credential

指定目標 SharePoint Online 網站的系統管理員帳戶認證。

Type:PSCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-GraphApiEndPoint

指定要使用的 GraphApiEndpoint,而非預設的一個。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-LocalSiteUrl

指定移轉來源。 可以是本機站台或本機中樞網站。

Type:Uri
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-LocalTermStoreName

指定本機站台的本機字詞庫名稱。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-RemoteSiteUrl

指定移轉目標。 您可以輸入遠端網站 URL 或遠端中樞網站 URL,這兩者都會經過處理成為中樞網站 URL。

Type:Uri
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

輸入

System.Uri

System.String System.String[] System.Management.Automation.PSCredential Microsoft.SharePoint.PowerShell.SPAssignmentCollection

輸出

System.Object