Note: PowerShell integration requires a ShareGate Migrate Pro or Enterprise subscription. It is not available on the Essentials plan.
Command
Save-SensitivityLabelMapping
Description
The command to save all the sensitivity label mappings for a specific source and destination site.
Examples
Save custom mappings for a source site and a destination site
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
$mappingSettings = Get-SensitivityLabelMapping -SourceSite $srcSite -DestinationSite $dstSite
$mappingSettings
# Example output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings : ParentSL \ ChildLabel1 -> ParentDestSL \ ChildDestLabel1
# ParentSL \ ChildLabel2 -> ParentDestSL \ ChildDestLabel2
# ParentSL \ ChildLabel3 -> <NO DESTINATION>
$mappingSettings = Set-SensitivityLabelMapping -MappingSettings $mappingSettings -Source "ParentSL \ ChildLabel3" -Destination "ParentDestSL \ ChildDestLabel1"
$mappingSettings = Set-SensitivityLabelMapping -MappingSettings $mappingSettings -Source "ParentSL \ ChildLabel2" -Ignore
$mappingSettings = Save-SensitivityLabelMapping -MappingSettings $mappingSettings -SourceSite $srcSite -DestinationSite $dstSite
$mappingSettings = Get-SensitivityLabelMapping -SourceSite $srcSite -DestinationSite $dstSite
$mappingSettings
# Example output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings : ParentSL \ ChildLabel1 -> ParentDestSL \ ChildDestLabel1
# ParentSL \ ChildLabel2 -> <NO DESTINATION>
# ParentSL \ ChildLabel3 -> ParentDestSL \ ChildDestLabel1
Syntax
Save-SensitivityLabelMapping
-MappingSettings <MappingSettings>
-SourceSite <Site>
-DestinationSite <Site>
Parameters
-DestinationSite <Site>
Specifies the destination site.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings to save.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-SourceSite <Site>
Specifies the source site.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
