Skip to main content
Get Permission Level Mapping
Updated over 4 months ago

Command

Get-PermissionLevelMapping

Description

The command to get the permission level mappings from a source and destination site pair.

Examples

Get 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 and display the current permission level mappings
$mappingSettings = Get-PermissionLevelMapping -SourceSite $srcSite -DestinationSite $dstSite
$mappingSettings

# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : Approve -> Approve
# Contribute -> Contribute
# Design -> Design
# Full Control -> Full Control
# My Custom Permission -> <NO DESTINATION>
# Read -> Read
# View Only -> View Only
# SiteTemplateMappings :

Get mappings from the file system and a destination site

# Connect to the destination site
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Retrieve permission level mappings from the file system and apply them to the destination site
$mappingSettings = Get-PermissionLevelMapping -FromFileSystem -DestinationSite $dstSite

# Display the retrieved permission level mappings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : Full Control -> Full Control
# Modify -> Contribute
# Read & execute -> Read
# Read -> Read
# Write -> Contribute
# SiteTemplateMappings :

Merge mappings with mappings from a source site and a destination site

# Map "My Custom Permission" to "Full Control"
$mappingSettings = Set-PermissionLevelMapping -Source "My Custom Permission" -Destination "Full Control"

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

# Retrieve and display the updated permission level mappings, with site context
$mappingSettings = Get-PermissionLevelMapping -MappingSettings $mappingSettings -SourceSite $srcSite -DestinationSite $dstSite
$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

Get-PermissionLevelMapping-SourceSite <Site>
-DestinationSite <Site>
[-MappingSettings <MappingSettings>]
Get-PermissionLevelMapping-FromFileSystem <SwitchParameter>
-DestinationSite <Site>
[-MappingSettings <MappingSettings>]

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

-FromFileSystem <SwitchParameter>

Specifies that the source is the file system.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

FileSystem

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

-SourceSite <Site>

Specifies the source site.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

Default

Aliases

None

Did this answer your question?