Automation: Powershell Force OneDrive to Re Sync if there is a Sync Error noted

Olivier Kip 0 Reputation points
2025-02-12T10:10:50.1+00:00

I am working for the MSP Lucrasoft, we use an RMM to automate powershell scripts to workdevices to monitor them.

We get a lot of "OneDrive for Business, error with syncing" alerts. What I always see is that if OneDrive is restarted (manually) the sync is done again and the error is solved.

Do people have a powershell script to "re sync", a script that we can initialize when an alert like this is coming up. So we don't have to manually restart or reïnstall onedrive to solve it

OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,307 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,748 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,811 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.