Command
Export-UserAndGroupMapping
Description
The command to export the user and group mappings to a file.
To learn more about your user and group mappings and how to export and import a ShareGate user mappings file (SGUM), see Map users and groups.
Examples
Export custom mappings
# Set the user and group mapping for "John Doe" -> "Paul Smith"
$mappingSettings = Set-UserAndGroupMapping -Source "John Doe" -Destination "Paul Smith"
# Update the mapping to include "myusername" -> "anotherusername"
$mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source "myusername" -Destination "anotherusername"
# Map unresolved users or groups to "Old employee Group"
$mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -UnresolvedUserOrGroup -Destination "Old employee Group"
# Export the final mapping settings to the specified file
Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyUserAndGroupMappingsFileName"
Export 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 existing user and group mappings
$mappingSettings = Get-UserAndGroupMapping -SourceSite $srcSite -DestinationSite $dstSite
# Export the current mappings to a local file
Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyUserAndGroupMappingsFileName"
Syntax
Export-UserAndGroupMapping-MappingSettings [-Path] [-Overwrite]
Parameters
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Overwrite <SwitchParameter>
Specifies the file that will be overwritten if already exists.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Path <String>
Specifies the path where you want to save the file. If this argument is not specified, the path of the save mapping file will be the same as the location where you are running the PowerShell script.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | PSPath |