SharePoint Online - Mapping Multiple Users Dynamically in ShareGate Migration Tool

Introduction

 
In this article, we explore how to ignore manual user mapping with the ShareGate migration tool. In this article, we explain how to map multiple users dynamically in the ShareGate migration tool.
 
The migration tools cover most Enterprise-level requirements and are well-suited for a vast number of content sources. With this in mind, we always should use a reputable tool to choose and advise us, on the basis that we choose the right SharePoint migration tool for our businesses.
 

Scenario

 
The Customer requires multiple users replaced with new users on multiple sites, about 10 + SharePoint online sites. For this requirement, the customer suggests the ShareGate migration tool.
 

Objective

 
We use ShareGate to archive this requirement, but in Sharegate if we have multiple site manual user mapping, it takes a lot of time for each site. Therefore, we ignored manual user mapping in ShareGate. Using PowerShell, we map multiple users dynamically in the ShareGate migration tool.
 
Follow the below steps:
 
Use PowerShell to generate a ShareGate Desktop user mapping file (.sgum) from a CSV document. We can use the user mapping file for your migrations in the ShareGate migration tool.
 
Step 1
 
Verify the Access to our users' information, or Active Directory exists or not. If not, set the access to users' information or Active directory
 
Step 2
 
We can create the CSV manually or get a list of users from Active Directory which we need to replace. We will need a final CSV file with two columns named SourceValue and DestinationValue. We can use email, username, display name, or full name, but we recommend using email addresses as they are usually unique and include the domain.
 
The file should look like this in Excel: UserFile.csv
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
Step 3
 
Create the following PowerShell script for create user mapping file(.sgum) 
  1. Import-Module Sharegate  
  2. $csvFile = "C:\ UserFile.csv"  
  3. $table = Import-CSV $csvFile -Delimiter ","  
  4. $mappingSettings = New-MappingSettings  
  5. foreach ($row in $table) {  
  6.     $results = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source $row.SourceValue -Destination $row.DestinationValue  
  7.     $row.sourcevalue  
  8. }  
  9. Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path "D:\MappingFileName"  
Step 4 - Open the ShareGate Desktop
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
After clicking the PowerShell option from ShareGate Desktop, the below screen appears. Then run the below screenshot:
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
PowerShell script mentioned the path location. Follow the path created UserAndGroupMappings.sgum
 
The mappings file should look like this:
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
Steps 5
 
ShareGate Desktop connects to Source and designation site, select the mappings option, then the below screen should appear. Follow the numerical points, as shown in the below screenshot and import the created user mapping file UserAndGroupMappings.sgum
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
Steps 6
 
After mapping the UserAndGroupMappings.sgum file, the mapping screen should look like below:
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool
 
Steps 7
 
Click on the Save button, then click on the Start Copy button to trigger the migration process.
 
SharePoint Online -Mapping Multiple Of Users Dynamically In ShareGate Migration Tool