Powers-hell to migrate content

%3CLINGO-SUB%20id%3D%22lingo-sub-756815%22%20slang%3D%22en-US%22%3EPowers-hell%20to%20migrate%20content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-756815%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Everyone%2C%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20find%20out%20a%20better%20Powershell%20which%20can%20be%20used%20to%20migrate%20content%20from%20on-prem%20drives%20to%20OneDrive%20for%20business.%20I%20have%20one%20from%20%22SharePoint%20migration%20tool%22%2C%20however%20I%20would%20like%20that%20to%20be%20able%20to%20migrate%20500%20users%20at%20a%20time%20and%20able%20to%20ignore%20folders%20that%20are%20not%20required%20and%20%22make%20modified%20date%20stamp%22%20as%20per%20our%20requirements.%20The%20reason%20why%20we%20want%20to%20explicitly%20stamp%20modified%20date%20is%20because%20of%20%22retention%20policies%22.%20We%20don't%20want%20to%20loose%20all%20the%20old%20content.%20Do%20we%20have%20one%20powershell%20like%20that%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20an%20expert%20in%20PowerShell%2C%20please%20suggest%20me%20best%20solution.%20My%20client%20is%20not%20interested%20in%20using%20any%20third%20part%20tool.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3Ecurrent%20powershell%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%23Define%20SPO%20target%23%3CBR%20%2F%3E%24Global%3ASPOUrl%20%3D%20%22%22%3CBR%20%2F%3E%24Global%3AUserName%20%3D%20%22%22%3CBR%20%2F%3E%24Global%3APassWord%20%3D%20ConvertTo-SecureString%20-String%20%22youpassword%22%20-AsPlainText%20-Force%3CBR%20%2F%3E%24Global%3ASPOCredential%20%3D%20New-Object%20-TypeName%20System.Management.Automation.PSCredential%20-ArgumentList%20%24Global%3AUserName%2C%20%24Global%3APassWord%3CBR%20%2F%3E%24Global%3ATargetListName%20%3D%20%22Documents%22%3C%2FP%3E%3CP%3E%23Define%20File%20Share%20data%20source%23%3CBR%20%2F%3E%24Global%3AFileshareSource%20%3D%20%22C%3A%5Ctest%22%3C%2FP%3E%3CP%3E%23Import%20SPMT%20Migration%20Module%23%3CBR%20%2F%3EImport-Module%20Microsoft.SharePoint.MigrationTool.PowerShell%3C%2FP%3E%3CP%3E%23Register%20the%20SPMT%20session%20with%20SPO%20credentials%23%3CBR%20%2F%3ERegister-SPMTMigration%20-SPOCredential%20%24Global%3ASPOCredential%20-Force%3C%2FP%3E%3CP%3E%23Add%20two%20tasks%20into%20the%20session.%20One%20is%20SharePoint%20migration%20task%2C%20and%20another%20is%20File%20Share%20migration%20task.%23%3CBR%20%2F%3E%23Add-SPMTTask%20-SharePointSourceCredential%20%24Global%3ASPCredential%20-SharePointSourceSiteUrl%20%24Global%3ASourceSiteUrl%20-TargetSiteUrl%20%24Global%3ASPOUrl%20-MigrateAll%3CBR%20%2F%3EAdd-SPMTTask%20-FileShareSource%20%24Global%3AFileshareSource%20-TargetSiteUrl%20%24Global%3ASPOUrl%20-TargetList%20%24Global%3ATargetListName%3C%2FP%3E%3CP%3E%23Start%20Migration%20in%20the%20console.%20%23%3CBR%20%2F%3EStart-SPMTMigration%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-756815%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOneDrive%20for%20Business%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-756914%22%20slang%3D%22en-US%22%3ERe%3A%20Powers-hell%20to%20migrate%20content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-756914%22%20slang%3D%22en-US%22%3EIt%20should%20not%20be%20a%20problem%20a%20migration%20scenario%20using%20SPMT%20PS%20cmdlets....you%20will%20need%20to%20prepare%20a%20CSV%20%2F%20JSON%20File%20(check%20SPMT%20documentation)%20where%20you%20have%20the%20ODFB%20sites%20where%20you%20want%20to%20migrate%20the%20content%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757263%22%20slang%3D%22en-US%22%3ERe%3A%20Powers-hell%20to%20migrate%20content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757263%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3Bthanks%20for%20your%20reply.%20what%20about%20modified%20time%20stamp%3F%20can%20we%20also%20apply%20this%20change%20during%20the%20migration%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello Everyone,

I am trying to find out a better Powershell which can be used to migrate content from on-prem drives to OneDrive for business. I have one from "SharePoint migration tool", however I would like that to be able to migrate 500 users at a time and able to ignore folders that are not required and "make modified date stamp" as per our requirements. The reason why we want to explicitly stamp modified date is because of "retention policies". We don't want to loose all the old content. Do we have one powershell like that? 

 

I am not an expert in PowerShell, please suggest me best solution. My client is not interested in using any third part tool. 

 

current powershell: 

 

#Define SPO target#
$Global:SPOUrl = ""
$Global:UserName = ""
$Global:PassWord = ConvertTo-SecureString -String "youpassword" -AsPlainText -Force
$Global:SPOCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:UserName, $Global:PassWord
$Global:TargetListName = "Documents"

#Define File Share data source#
$Global:FileshareSource = "C:\test"

#Import SPMT Migration Module#
Import-Module Microsoft.SharePoint.MigrationTool.PowerShell

#Register the SPMT session with SPO credentials#
Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force

#Add two tasks into the session. One is SharePoint migration task, and another is File Share migration task.#
#Add-SPMTTask -SharePointSourceCredential $Global:SPCredential -SharePointSourceSiteUrl $Global:SourceSiteUrl -TargetSiteUrl $Global:SPOUrl -MigrateAll
Add-SPMTTask -FileShareSource $Global:FileshareSource -TargetSiteUrl $Global:SPOUrl -TargetList $Global:TargetListName

#Start Migration in the console. #
Start-SPMTMigration

2 Replies
It should not be a problem a migration scenario using SPMT PS cmdlets....you will need to prepare a CSV / JSON File (check SPMT documentation) where you have the ODFB sites where you want to migrate the content

@Juan Carlos González Martín thanks for your reply. what about modified time stamp? can we also apply this change during the migration