Command
Set-PermissionLevelMapping
Description
The command to add or update a permission level mapping in the mapping settings.
Examples
Set custom mappings
# Set the permission level mapping for "My Custom Permission" -> "Full Control"
$mappingSettings = Set-PermissionLevelMapping -Source "My Custom Permission" -Destination "Full Control"
# Ignore the "Read" permission level
$mappingSettings = Set-PermissionLevelMapping -MappingSettings $mappingSettings -Source "Read" -Ignore
# Display the updated permission level mappings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : My Custom Permission -> Full Control
# Read -> <NO DESTINATION>
# SiteTemplateMappings :
Set custom mappings on existing 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"
# Retrieve the current permission level mappings
$mappingSettings = Get-PermissionLevelMapping -SourceSite $srcSite -DestinationSite $dstSite
# Map "My Custom Permission" to "Full Control"
$mappingSettings = Set-PermissionLevelMapping -MappingSettings $mappingSettings -Source "My Custom Permission" -Destination "Full Control"
# Ignore the "Read" permission level
$mappingSettings = Set-PermissionLevelMapping -MappingSettings $mappingSettings -Source "Read" -Ignore
# Display the updated permission level mappings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : Approve -> Approve
# Contribute -> Contribute
# Design -> Design
# Full Control -> Full Control
# My Custom Permission -> Full Control
# Read -> <NO DESTINATION>
# View Only -> View Only
# SiteTemplateMappings :
Syntax
Set-PermissionLevelMapping -Source <String> -Destination <String> [-MappingSettings <MappingSettings>]
Set-PermissionLevelMapping-Source <String> -Ignore <SwitchParameter> [-MappingSettings <MappingSettings>]
Parameters
-Destination <String>
Specifies the destination permission level.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default |
Aliases | None |
-Ignore <SwitchParameter>
Specifies to ignore the permission level.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | ExplicitIgnoreDestination |
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 permission level.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |