Is there any way to get the sync status using PowerShell Script?

Frequent Contributor



Is there any way to get the sync status using PowerShell Script if user is doing syncing first time ?



9 Replies
Theres no way out of the box!

You can use the onedrivelib.dll to fetch some information via a script and it’s a bit tricky to get it to run remotely

Possible values:
Error, Shared, SharedSync, UpToDate, Syncing, ReadOnly, NotInstalled

See here:

And here:


@adam deltinger I aleady saw this url and tried following script


Import-Module ".\OneDriveLib.dll"

Get-ODStatus -ByPath $env:OneDrive


Getting Syncing or OneDemandOruknown during syncing.


How to check in script that once status is UptoDate status, script should terminate especially when user is syncing first time and data size is large. I dont think running in infinite loop is good idea.


Please advise.


I think i read somewhere , this breaks if FOD is used though..

I guess writing some sort of IF statement depending on status would help!

What’s your usecase here?

@adam deltinger 


I created script where I am initiating ODB wizard, once user completed the wizard thne copying the contents automatically from file server to user local OneDrive cache folder. Once contents is copied, add a record with copy completion status in dashboardlog which is exist in one common repository. This script pushing thru SCCM, this will run only once. This is implemented for so many users. Now I want to track the sync status for each user. Once sync is completed then I can update in dashboardlog. I want this activity should be part of above script.


Let me know if you have some better idea.


Can you share some more information that Get-ODStatus is failed if FOD is enabled?




Can’t seem to find it, so ignore that part for now :)

@adam deltinger I found it. Check this


My sync is completed now it is showing status as OnDemandorUnknown instead on UptoDate. As per the above link other user is also noticed same. See the June 14th Post.



Have you checked ODFB usage reports?
AFAIK there are no sync status parameters in there
There are uservoice request for this simple feature to a simple solution but not evwn a We are looking into it from microsoft. It is almost like they are happy there is one or two third party vendor selling this I am sure not for a nickle.