Who's Online
4 visitors online now
2 guests, 2 bots, 0 members
Support my Sponsor
  • An error has occurred, which probably means the feed is down. Try again later.

SharePoint PowerShell to identify all OneDrive sites and migrate content to SharePoint sites

I wanted to perform migration of few of my users content to their respective OneDrive site. To do so, I used below PowerShell to identify URL of all users who already have a OneDrive sites and then used FileMigration wizard to import their content in the respective OneDrive Site.

$TenantUrl = Read-Host "https://tenantname-admin.sharepoint.com/"
$LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log"
Connect-SPOService -Url $TenantUrl
Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select -ExpandProperty Url | Out-File $LogFile -Force
Write-Host "Done! File saved as $($LogFile)."
Once you have the list of OneDrive path, go to SharePoint Admin center > Select Migration > File Share Migration > Download and install the migration agent.
Note : Note agent should be installed on a system which should have access to the files through network drive we want to migrate
Use the user which you wish to use for migration and then provide the FileSharePath at the bottom of the screen. You can test if you have access to the UNC path using test button.
Once everything is setup, you need can close this agent and let it run in the background. It will take sometime for the agent to appear in the SharePoint Admin center Agents screen

Select Add task from Migration screen
Select ‘Single source and destination’ and then select next
Put the path of the users folder and select next
Select OneDrive icon and select next
Select the OneDrive path URL and then select the Document library you want the files to be migrated. Then select Next
Prove the TaskName, Select the Active Agents and make sure you select Perform scan only and Preserve file share permissions as required. Select Next

5 Responses to “SharePoint PowerShell to identify all OneDrive sites and migrate content to SharePoint sites”

  • pastiwin88:

    After looking over a handful of the blog articles
    on your site, I really like your way of writing a blog.

    I saved it to my bookmark website list and will be checking back soon. Please check out my web
    site too and tell me your opinion.

  • w:

    Hey there, You have done a fantastic job.
    I’ll certainly digg it and personally recommend to my friends.
    I’m confident they will bee benefited from this web site.

  • Anonymous:

    Write more, thats all I have to say. Literally, it seems
    as though you relied on the video to make your point.
    You obviously know what youre talking about, why waste your intelligence on just
    posting videos to your weblog when you could be giving us something enlightening to read?

  • haber oku:

    My family members all the time say that I am wasting my time here at web, except I know I am getting knowledge everyday by reading thes pleasant articles.

  • haber oku:

    I am truly grateful to the holder of this website who has shared this impressive piece of writing at at
    this place.