Copy-SPContentTypes

Specifies content types for replicating from on-premises to SharePoint Online (SPO) environment.

Syntax

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

Description

This cmdlet is used in hybrid scenarios with SharePoint Online to copy Content Types from an on-premises farm to SharePoint Online.

Examples

Example 1

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

This example migrates the specified content types named: ContentTypeA, ContentTypeB on the local site https://localsite/ whose term store named "managed metadata service application proxy" to the hub site of remote site https://contoso.sharepoint.com/. If the remote site is a hub site, the migration target will be itself.

Parameters

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

NOTE: When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

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

Specifies the AuthEndpoint to use, but not the default one.

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

Specifies the content type names to be migrated. Can be in a form of an array.

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

Specifies the administrator account credential of the target SharePoint Online site.

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

Specifies the GraphApiEndpoint to use, but not the default one.

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

Specifies the migration source. Can be a local site or a local hubsite.

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

Specifies the name of the local term store of the local site.

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

Specifies the migration target. You can input a remote site url or remote hub site url, both will be processed to be the hub site 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

Inputs

System.Uri

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

Outputs

System.Object