Skip to main content

Set-SensitivityLabelMapping

PowerShell cmdlet reference for Set-SensitivityLabelMapping.

Note: PowerShell integration requires a ShareGate Migrate Pro or Enterprise subscription. It is not available on the Essentials plan.

Command

Set-SensitivityLabelMapping

Description

The command to add or update a sensitivity label mapping in the mapping settings.

Examples

Set custom mappings

$mappingSettings = Set-SensitivityLabelMapping -Source "ParentSL \ ChildLabel1" -Destination "ParentDestSL \ ChildDestLabel1"
$mappingSettings = Set-SensitivityLabelMapping -MappingSettings $mappingSettings -Source "ParentSL \ ChildLabel2" -Ignore
$mappingSettings

# Example output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings : ParentSL \ ChildLabel1 -> ParentDestSL \ ChildDestLabel1
# ParentSL \ ChildLabel2 -> <NO DESTINATION>

Set custom mappings on existing mappings from 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 = Set-SensitivityLabelMapping -MappingSettings $mappingSettings -Source "ParentSL \ ChildLabel3" -Destination "ParentDestSL \ ChildDestLabel1"
$mappingSettings = Set-SensitivityLabelMapping -MappingSettings $mappingSettings -Source "ParentSL \ ChildLabel2" -Ignore
$mappingSettings

# Example output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings : ParentSL \ ChildLabel1 -> ParentDestSL \ ChildDestLabel1
# ParentSL \ ChildLabel2 -> <NO DESTINATION>
# ParentSL \ ChildLabel3 -> ParentDestSL \ ChildDestLabel1

Syntax

Set-SensitivityLabelMapping
-Source <String>
-Destination <String>
[-MappingSettings <MappingSettings>]
Set-SensitivityLabelMapping
-Source <String>
-Ignore <SwitchParameter>
[-MappingSettings <MappingSettings>]
Set-SensitivityLabelMapping
-DefaultDestinationLabel <SwitchParameter>
-Destination <String>
[-MappingSettings <MappingSettings>]

Parameters

-DefaultDestinationLabel <SwitchParameter>

Specifies the default destination sensitivity label, applied to source labels that have no explicit mapping.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Destination <String>

Specifies the destination sensitivity label.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Ignore <SwitchParameter>

Specifies to ignore the sensitivity label.

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.

Required?

False

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Source <String>

Specifies the source sensitivity label.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

Did this answer your question?