When you export your mailbox and recipient mappings in the app, they are separated.
You can use the following script to combine the mappings you exported from the app for PowerShell:
# Import the mailbox mappings CSV file
# -Path specifies the location of the mailbox mappings file
$sharegateMailboxesMapping = Import-Csv -Path ".\SharegateMailboxMappings.csv"
# Import the recipient mappings CSV file
# -Path specifies the location of the recipient mappings file
$sharegateRecipientsMapping = Import-Csv -Path ".\SharegateRecipientMappings.csv"
# Combine the mailbox and recipient mappings and remove duplicates
# Duplicates are removed based on the 'Source user id' property
$combinedCsv = $sharegateMailboxesMapping + $sharegateRecipientsMapping | Sort-Object "Source user id" -Unique
# Export the combined data to a new CSV file
# -Path specifies the location of the output file
# -NoTypeInformation omits type information from the exported CSV
$combinedCsv | Export-Csv -Path ".\ShareGatePowerShellMailboxMappings.csv" -NoTypeInformation
Adjust -Path ".\SharegateMailboxesMapping.csv"
and -Path ".\SharegateRecipientsMapping.csv"
to match your respective CSV file's location and file names.
Note: The mappings are already combined when you export them in PowerShell with Export-MailboxMappings
.