How to synchronize IE favorites to OneDrive (PowerShell)
Introduction
The goal of this script is synchronizing IE favorites to OneDrive.
Scenarios
Internet Explorer 11 can synchronize favorites in Windows 8.1. However on older system such as Windows 7, there is no such functionality. This script is to synchronize IE favorites with OneDrive.
Script
Step 1: Right click the script and select Run with PowerShell.
Step 2: Then if you have installed OneDrive and have selected the default installation, you will see the following figure.
Here are some code snippets for your reference:
If(Test-Path -Path $SkyDrive)
{
Set-ItemProperty -Path $USFReg -Name "Favorites" -Value $SkyDriveF
Set-ItemProperty -Path $SFReg -Name "Favorites" -Value $SkyDriveF
Copy-Item -Path $env:USERPROFILE\Favorites -Destination $SkyDrive -Force -Recurse
Write-Host “Add IE favroties to OneDrive successfully. You need to restart IE to take effect."
}
Elseif(Test-path -Path $OneDrive)
{
Set-ItemProperty -Path $USFReg -Name "Favorites" -Value $OneDriveF
Set-ItemProperty -Path $SFReg -Name "Favorites" -Value $OneriveF
Copy-Item -Path $env:USERPROFILE\Favorites -Destination $OneDrive -Force -Recurse
Write-Host “Add IE favroties to OneDrive successfully. You need to restart IE to take effect."
}
If(Test-Path -Path $SkyDrive) { Set-ItemProperty -Path $USFReg -Name "Favorites" -Value $SkyDriveF Set-ItemProperty -Path $SFReg -Name "Favorites" -Value $SkyDriveF Copy-Item -Path $env:USERPROFILE\Favorites -Destination $SkyDrive -Force -Recurse Write-Host “Add IE favroties to OneDrive successfully. You need to restart IE to take effect." } Elseif(Test-path -Path $OneDrive) { Set-ItemProperty -Path $USFReg -Name "Favorites" -Value $OneDriveF Set-ItemProperty -Path $SFReg -Name "Favorites" -Value $OneriveF Copy-Item -Path $env:USERPROFILE\Favorites -Destination $OneDrive -Force -Recurse Write-Host “Add IE favroties to OneDrive successfully. You need to restart IE to take effect." }
Prerequisite
Windows 7 or higher version
OneDrive
Microsoft All-In-One Script Framework is an automation script sample library for IT Professionals. The key value that All-In-One Script Framework is trying to deliver is Scenario-Focused Script Samples driven by IT Pros' real-world pains and needs. The team is monitoring all TechNet forums, IT Pros' support calls to Microsoft, and script requests submitted to TechNet Script Repository. We collect frequently asked IT scenarios, and create script samples to automate the tasks and save some time for IT Pros. The team of All-In-One Script Framework sincerely hope that these customer-driven automation script samples can help our IT community in this script-centric move.