Forum Discussion
Is there any way to get the sync status using PowerShell Script?
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:
https://blogs.msdn.microsoft.com/rodneyviana/2017/06/06/powershell-cmdlet-to-check-onedrive-for-business-or-onedrive-personal-status/
And here:
https://www.intrust-it.com/2017/11/17/centrally-monitor-microsoft-onedrive-sync-status/
Adam
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.
Avian
- Jun 18, 2019I 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?- Avian 1Jun 18, 2019Iron Contributor
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?
Thanks
Avian
- Jun 18, 2019Can’t seem to find it, so ignore that part for now :)