Centrally Monitor Microsoft OneDrive Sync Status

How to Centrally Monitor Microsoft OneDrive Sync Status

Unfortunately, Microsoft hasn’t provided a good way to monitor OneDrive sync status centrally, which is why we’ve kept it at arm’s length for customer solutions.

Without central reporting through Office 365, we have to rely on endpoint monitoring of the sync client itself. The key to accomplishing this is a custom OneDriveLib.dll which interfaces with the OneDrive API and reports on sync status of the locally installed OneDrive client.

For OneDriveLib to work, you must query each OneDrive path within the user profile. It is an open-source project, which can be downloaded here. There is also a post about this on the Microsoft Developer Network.

Using OneDriveLib

So now that we’ve established what OneDriveLib is and what it does, here’s how we use it.

OneDriveLib needs to be on the system being monitored, and can be used within PowerShell by importing it like a module (Install-Module OneDriveLib.dll). From there, running Get-ODstatus -ByPath OneDrivePath will report the sync status of the OneDrive library. The statuses that may be reported are:

  • Error
  • Shared
  • SharedSync
  • UpToDate
  • Syncing
  • ReadOnly
  • NotInstalled

To accomplish this, we push OneDriveLib and a PowerShell script to pull the data that we’re looking for. This script reports the status of the OneDrive for Business (excluding Personal) client, writes a status.log to a temp directory. This status.log then gets pulled into a custom field in Kaseya. If that custom field gets set to Error, then it creates a ticket for our support team to investigate the issue. Any file that fails to sync will put the client into an Error state.

Now that we have a central way to monitor OneDrive sync status, we are more comfortable using Microsoft OneDrive for Business as a solution for our clients.

Here’s the PowerShell script we use:

Import-Module “OneDriveLib.dll”

$results = @()

$tresults = New-Object PSObject

$textfile = ‘status.log’

$ucontents = Get-ChildItem $env:USERPROFILE | Where-Object {(($_ -like “*OneDrive*”) -or ($_ -like “*SharePoint*”)) -and (-not ($_ -contains “Unsynced”))}

Eric Fox | Intrust IT Support Cincinnati

Eric Fox

Eric Fox is a Business Development Manager and is excited and just as invested in your business's success as you are. He's ready to work alongside your internal tech team or find the right solution to your IT problems.

Share this Blog

Enterprise Password Management Promo Wide

Is Your Name or Birthday a Part of Your Password?

If so, you’re a part of the 59 percent of people who don’t follow proper password hygiene. More than 70 percent of passwords are used for more than one system, meaning if cybercriminals crack one, they can access a lot more accounts.

Our free Enterprise Password Management Guide will give you the best password hygiene practices to help you secure your computer and your business.

Download the Guide

Explore the Latest Trends in IT

What are managed services - Intrust IT

What Are Managed Services? And What Are the Benefits?

Running a business in today’s tech-driven world means you need reliable IT infrastructure. But let’s be honest, managing IT in-house...
Windows 10 End of Life How This Could Impact Your Business - Intrust IT

Windows 10 End of Life: How It Could Impact Your Business

As Microsoft officially plans to end support for Windows 10 on October 14, 2025, businesses need to begin thinking ahead....
AI implementation Roadmap Intrust IT

Master AI Integration With Our AI Implementation Roadmap Guide

AI is one of the greatest technological breakthroughs of the last few years. It has become our handy assistant, data...
9 days on a cruise - Intrust IT

Redefining Culture in IT Companies: Nine Days Away on an American River Cruise

What would you do with nine days away from your keyboard? Would you take a relaxing vacation? Or spend time...
National Public Data Breach- Intrust IT

Was Your SSN Leaked? Understanding the Impact of a National Public Data Breach

A recent national public data breach has sent shockwaves through the country, exposing the sensitive data of millions of Americans....
What are Managed IT Services A Simple Guide Intrust IT

What Are Managed IT Services? A Simple Guide

Whether you are a part of a large corporation or a smaller business, you likely have run into IT issues...