Skip to main content
Export Site Template Mapping
Updated over 3 months ago

Command

Export-SiteTemplateMapping

Description

The command to export the site template mappings to a file.

Examples

Export custom mappings

# Set a default site template mapping for "Team Site" across all languages
$mappingSettings = Set-SiteTemplateMapping -DefaultTemplate -Destination "Team Site" -AllLanguages

# Add a site template mapping for "Blank Site" to "STS#0" for all languages
$mappingSettings = Set-SiteTemplateMapping -MappingSettings $mappingSettings -Source "Blank Site" -Destination "STS#0" -AllLanguages

# Add a site template mapping for "Blank Site" in French ("fr-fr") to "STS#0" in English ("en-us")
$mappingSettings = Set-SiteTemplateMapping -MappingSettings $mappingSettings -Source "Blank Site" -SourceLanguage "fr-fr" -Destination "STS#0" -DestinationLanguage "en-us"

# Export the site template mappings to a file
Export-SiteTemplateMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MySiteTemplateMappings"

Export mappings from a source site and a destination site

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

# Retrieve site template mappings between the source and destination sites
$mappingSettings = Get-SiteTemplateMapping -SourceSite $srcSite -DestinationSite $dstSite

# Export the retrieved site template mappings to a file
Export-SiteTemplateMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MySiteTemplateMappings"

Syntax

Export-SiteTemplateMapping-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 the file will be overwritten if 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?