Reset OneDrive
Code
| <#
.SYNOPSIS
Run this as the current user to reset OneDrive
.DESCRIPTION
Be patient with this as once the process is started OneDrive will take quite some time to show any activity.
Sometimes you get a message saying "Couldn't reset (Something went wrong)".
Ignore this and leave the machine for about an hour and reboot.
.NOTES
VERSION : 1
UPDATED : 2024-09-23
AUTHOR : Noxcivis
LICENSE : MIT
SOURCE : hhttps://noxcivis.supportmarks.com
NOTES : No additional notes
LOCAL ADMIN : No
REMOTE ADMIN : No
#>
Clear-Host
# Resets OneDrive installation in Program Files
$OneDrivePath = "$env:ProgramFiles\Microsoft OneDrive\onedrive.exe"
Write-Host "Using OneDrive path : $OneDrivePath"
Write-Host "Terminating OneDrive"
Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
Write-Host "Resetting OneDrive now"
Start-Process $OneDrivePath -ArgumentList "/reset" -NoNewWindow
Start-Sleep -Seconds 5
Write-Host "Re-launching OneDrive"
Start-Process $OneDrivePath -NoNewWindow
Write-Host "Sometimes you get a message saying ""Couldn't reset (Something went wrong)"". Ignore this and reboot in an hour."
Write-Host "OneDrive will perform the reset in the background so check back later."
Write-Host "This could take a while. Be patient. This machine may feel a bit slow while the reset process runs."
|
TIP
Save as reset-onedrive.ps1