If you have many users to manually map in the Map users and groups window, you can use PowerShell to generate the mapping file using a CSV file.
The CSV file needs to be created beforehand and must contain information that can be found in the SharePoint people picker.
CSV File Creation
Here's how you can fill your CSV file. In the current example, my two columns are named SourceValue and DestinationValue, and we will set the variable $csvfile:
In this case, the email was used, but it can also be the username, the display name, or the full name. It is found using the people picker.
$csvFile = "C:\CSVfile.csv"
#Create a table based on the csv
$table = Import-CSV $csvFile -Delimiter ","
#Declaration of the mapping settings:
$mappingSettings = New-MappingSettings
#Cycle through each row of the CSV
foreach ($row in $table)
#Add the current row source user and destination user to the mapping list
$results = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source $row.SourceValue -Destination $row.DestinationValue
#The user and group mappings are exported to C:\FolderName\FileName.sgum Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path C:\FolderName\FileName
Once this is done, you can then use the FileName.sgum file in your migration script by using the following line:
$mappingSettings = Import-UserAndGroupMapping -Path C:\FolderName\FileName.sgum
Then, add the following at the end of your Copy line (works with all the copy options like Copy-Site and Copy-Content).
You can also Import this file in the Sharegate UI by pressing the Import button in the Map users and groups menu.