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
Step 3
Create the following PowerShell script for create user mapping file(.sgum)
- Import-Module Sharegate
- $csvFile = "C:\ UserFile.csv"
- $table = Import-CSV $csvFile -Delimiter ","
- $mappingSettings = New-MappingSettings
- foreach ($row in $table) {
- $results = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source $row.SourceValue -Destination $row.DestinationValue
- $row.sourcevalue
- }
- Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path "D:\MappingFileName"
Step 4 - Open the ShareGate Desktop
After clicking the PowerShell option from ShareGate Desktop, the below screen appears. Then run the below screenshot:
PowerShell script mentioned the path location. Follow the path created UserAndGroupMappings.sgum
The mappings file should look like this:
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
Steps 6
After mapping the UserAndGroupMappings.sgum file, the mapping screen should look like below:
Steps 7
Click on the Save button, then click on the Start Copy button to trigger the migration process.