Command
Get-UserAndGroupMapping
Description
The command to get the user and group mappings from a source site and a destination site.
Index
Examples
Get 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-UserAndGroupMapping -SourceSite $srcSite -DestinationSite $dstSite $mappingSettings PropertyMappings : ContentTypeMappings : UserAndGroupMappings : CustomPermissions Members -> Sales&Marketing Owners i:0#.w|office\sg.achille -> i:0#.w|office\sg.baptiste i:0#.w|office\sg.camille -> i:0#.w|office\sg.denis PermissionLevelMappings : SiteTemplateMappings :
Get mappings from the file system and a destination site
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $mappingSettings = Get-UserAndGroupMapping -FromFileSystem -DestinationSite $dstSite $mappingSettings PropertyMappings : ContentTypeMappings : UserAndGroupMappings : OFFICE\Employee -> Sales&Marketing Owners OFFICE\sg.achille -> i:0#.w|office\sg.baptiste OFFICE\sg.camille -> i:0#.w|office\sg.denis PermissionLevelMappings : SiteTemplateMappings :
Merge mappings with mappings from a source site and a destination site
$mappingSettings = Set-UserAndGroupMapping -Source "John Doe" -Destination "Paul Smith" $mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source "myusername" -Destination "anotherusername" $mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -UnresolvedUserOrGroup -Destination "Old employee Group" $srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite" $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $mappingSettings = Get-UserAndGroupMapping -MappingSettings $mappingSettings -SourceSite $srcSite -DestinationSite $dstSite $mappingSettings PropertyMappings : ContentTypeMappings : UserAndGroupMappings : <Unresolved users or groups> -> Old employee Group CustomPermissions Members -> Sales&Marketing Owners i:0#.w|office\sg.achille -> i:0#.w|office\sg.baptiste i:0#.w|office\sg.camille -> i:0#.w|office\sg.denis John Doe -> Paul Smith myusername -> anotherusername PermissionLevelMappings : SiteTemplateMappings :
Syntax
Get-UserAndGroupMapping -SourceSite <Site> -DestinationSite <Site> [-MappingSettings <MappingSettings>]
Get-UserAndGroupMapping -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 |