This article will show you how to fill your CSV file.
In the following example, the two columns are named SourceValue and DestinationValue, and the set variable is $csvFile
$csvFile = "C:\CSVfile.csv"
John Doe,Johnny Doe
Mary Doe,Maria Doe
# Create a table based on the csv file:
$table = Import-Csv $csvFile -Delimiter ","
# Declaration of the mapping settings:
$mappingSettings = New-MappingSettings
# Cycle through each row of the csv file:
foreach ($row in $table)
#add the current row's source user and destination user to the list of mappings
Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source $row.SourceValue -Destination $row.DestinationValue
# The user and group mappings are exported to:
Export-UserAndGroupMapping -MappingSettings $mappingSettings -Path C:\FolderName\FileName
Once this is done, you can then use the MyUserAndGroupMappingsFileName.sgum (or whatever you'd prefer to call it) file in your migration script by using the following line:
$mappingSettings = Import-UserAndGroupMapping -Path C:\FolderName\FileName.sgum