Jun 18 2019 01:28 AM
Hello
Is there any way to get the sync status using PowerShell Script if user is doing syncing first time ?
Avian
Jun 18 2019 01:44 AM
Jun 18 2019 02:49 AM
@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 2019 02:57 AM
Jun 18 2019 03:39 AM - edited Jun 18 2019 03:40 AM
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 2019 04:53 AM
Jun 18 2019 05:21 AM
@adam deltinger I found it. Check this
https://github.com/rodneyviana/ODSyncService/issues/3
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.
Avian
Jun 18 2019 07:02 AM
Jun 18 2019 07:20 AM
Feb 05 2020 09:56 PM
Jul 04 2022 06:44 AM - edited Jul 04 2022 06:50 AM
The dll mentioned in this thread is good, but I don't want to have to distribute that to everyone's machines, so I came up with an alternative. The script that follows would check OneDrive for a folder called Documents and returns its status.
# ID 303 = "Availability status" | The status is generally one of the following...
# "Always available on this device", "Available on this device", "Available when online"
$OneDriveDocs = "$env:OneDrive\Documents"
$Shell = (New-Object -ComObject Shell.Application).NameSpace((Split-Path $OneDriveDocs))
$Status = $Shell.getDetailsOf(($Shell.ParseName((Split-Path $OneDriveDocs -Leaf))),303)