Copy-SPContentTypes
Specifies content types for replicating from on-premises to SharePoint Online (SPO) environment.
Syntax
Default (Default)
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
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
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.
Parameter properties
Type: | SPAssignmentCollection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-AuthEndpoint
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the AuthEndpoint to use, but not the default one.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ContentTypeNames
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the content type names to be migrated. Can be in a form of an array.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Credential
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the administrator account credential of the target SharePoint Online site.
Parameter properties
Type: | PSCredential |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-GraphApiEndPoint
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the GraphApiEndpoint to use, but not the default one.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-LocalSiteUrl
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the migration source. Can be a local site or a local hubsite.
Parameter properties
Type: | Uri |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-LocalTermStoreName
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
Specifies the name of the local term store of the local site.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-RemoteSiteUrl
Applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
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.
Parameter properties
Type: | Uri |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
System.Uri
System.String System.String[] System.Management.Automation.PSCredential Microsoft.SharePoint.PowerShell.SPAssignmentCollection