Skip to main content
Export Content Type Mapping
Updated over 3 months ago

Command

Export-ContentTypeMapping

Description

The command to export the content type mappings to a file.

Examples

Export custom mappings

# Set content type mapping for Image to Picture
$mappingSettings = Set-ContentTypeMapping -Source Image -Destination Picture

# Add mapping for Video to Movie
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "Video" -Destination "Movie"

# Add mapping for a custom content type and set it to ignore
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "My Custom Content Type" -Ignore

# Export the content type mappings to a specified file
Export-ContentTypeMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyContentTypeMappingsFileName"

Export mappings from a source list and a destination list

# Connect to the source and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Get the source list from the source site
$srcList = Get-List -Name mysrclist -Site $srcSite

# Get the destination list from the destination site
$dstList = Get-List -Name mydstlist -Site $dstSite

# Retrieve content type mappings between the source and destination lists
$mappingSettings = Get-ContentTypeMapping -SourceList $srcList -DestinationList $dstList

# Export the content type mappings to a file
Export-ContentTypeMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyContentTypeMappingsFileName"

Syntax

Export-ContentTypeMapping-MappingSettings <MappingSettings>
[-Path <String>] 
[-Overwrite <SwitchParameter>]

Parameters

-MappingSettings <MappingSettings>

Specifies the mapping settings.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Overwrite <SwitchParameter>

Specifies that the file will be overwritten if it already exists.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Path <String>

Specifies the path where you want to save the file.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

PSPath

Did this answer your question?