How to use it:
- Download the latest release (32 or 64 bits)
- Make sure ODSyncUtil.exe and Get-ODStatus are in the same folder (otherwise you need inform the path with parameter -ExePath)
- Run ./Get-ODStatus.ps1
- Examples 1:
.\Get-ODStatus.ps1
SyncRootId : OneDrive!S-1-12-1-11700000-12300000-1832875930-630280000!Business1|10935082bea94993a9037f7a6709947e
CurrentState : 0
CurrentStateString : Synced
Sid : S-1-12-1-11700000-12300000-1832875930-630280000
UserName : CONTOSO\rviana
ServiceName : Business1
FolderPath : C:\Users\rviana.CONTOSO\OneDrive - Contoso
Label : OneDrive
IconUri : file:///C:/Users/rviana/AppData/Local/Microsoft/OneDrive/24.017.0123.0001/images/lightTheme/CloudIconSynced.svg
isQuotaAvailable : True
TotalQuota : 5497558138880
UsedQuota : 74059110815
QuotaLabel : 69.0 GB used of 5 TB (1%)
IconColorA : 255
IconColorR : 0
IconColorG : 95
IconColorB : 184
SyncRootId : OneDrive!S-1-12-1-11700000-12300000-1832875930-630280000!Personal|B7C3EE2A336CFE2E!125
CurrentState : 0
CurrentStateString : Synced
Sid : S-1-12-1-11700000-12300000-1832875930-630280000
UserName : CONTOSO\rviana
ServiceName : Personal
FolderPath : C:\Users\rviana.CONTOSO\OneDrive
Label : OneDrive
IconUri : file:///C:/Users/rviana/AppData/Local/Microsoft/OneDrive/24.017.0123.0001/images/lightTheme/CloudIconSynced.svg
isQuotaAvailable : True
TotalQuota : 1166083620864
UsedQuota : 293453640500
QuotaLabel : 273.3 GB used of 1 TB (25%)
IconColorA : 255
IconColorR : 0
IconColorG : 95
IconColorB : 184
- Example 2 (.exe in another folder):
.\Get-ODStatus.ps1 -ExePath d:\tools
SyncRootId : OneDrive!S-1-12-1-11700000-12300000-1832875930-630280000!Business1|10935082bea94993a9037f7a6709947e
CurrentState : 0
Sid : S-1-12-1-11700000-12300000-1832875930-630280000
UserName : CONTOSO\rviana
ServiceName : Business1
Label : OneDrive
IconUri : file:///C:/Users/rviana/AppData/Local/Microsoft/OneDrive/24.017.0123.0001/images/lightTheme/CloudIconSynced.svg
isQuotaAvailable : True
TotalQuota : 5497558138880
UsedQuota : 74059110815
QuotaLabel : 69.0 GB used of 5 TB (1%)
IconColorA : 255
IconColorR : 0
IconColorG : 95
IconColorB : 184
SyncRootId : OneDrive!S-1-12-1-11700000-12300000-1832875930-630280000!Personal|B7C3EE2A336CFE2E!125
CurrentState : 0
Sid : S-1-12-1-11700000-12300000-1832875930-630280000
UserName : CONTOSO\rviana
ServiceName : Personal
Label : OneDrive
IconUri : file:///C:/Users/rviana/AppData/Local/Microsoft/OneDrive/24.017.0123.0001/images/lightTheme/CloudIconSynced.svg
isQuotaAvailable : True
TotalQuota : 1166083620864
UsedQuota : 293453640500
QuotaLabel : 273.3 GB used of 1 TB (25%)
IconColorA : 255
IconColorR : 0
IconColorG : 95
IconColorB : 184
- As requested by user @aakash-shah, I have added the status string to the output. The status string is the human-readable version of the status.
- In this same request, I added the local path to the output. This is useful when you have multiple OneDrive accounts and you want to know which one is being reported.
- There is now a DLL version that is usefull if you want to use it in your own application. The DLL is located in the Binaries folder.
- There is a PowerShell version that is a wrapper around the DLL. The DLL is located in the Binaries folder.
- Prefer to use the PowerShell version that call the .EXE (Get-ODStatus.ps1)
- You don't need the DLL and .EXE at the same time. You can choose one or another with its appropriate PowerShell script.
ODSyncUtil.exe
can be called directly and it accepts parameters that can help troubleshoot the application.
Usage: ODSyncUtil [options]
-h Show this help message
-s <filename> Save the output to file (unicode little-endian by default)
-d Debug the application
-q Ignore quota information (avoid crash situations)
Example: save the output to a file and show debugging steps:
ODSyncUtil.exe -s output.txt -d
If you want to open an issue, please copy and paste the output of ODSyncUtil.exe -d
- feel free to obfuscate SIDs
Symptom:
You see the information below when running ODSyncUtil
-d:
CoCreateInstance Storage Provider for OneDrive: 0x80004002
Cause:
Your Windows version does not include IStorageProviderStatusUISourceFactory registration
Solution:
- Upgrade Windows 11 to the newest version (preferred)
- If not possible to update follow steps in "Windows 10 Additional Configuration (Don't come here if you are using it on Windows 11)" even if you are running Windows 11
- Windows 10 version only works on Windows 10 64-bit (no 32-bit version for now)
- Windows 10 requires the installation of a Proxy / Stub for the StorageProvider for OneDrive
- Download OneDriveFlyoutPS.dll
- Unblock the DLL ( Right Click | Properties... | Unblock )
- Register the DLL using: regsvr32 and take note of the download folder. It is necessary to run this in the command prompt as ADMINISTRATOR or you will get access denied. The command below is using c:\temp as the folder where
OneDriveFlyoutPS.dll
is locatedPlease adjust it accordingly
regsvr32 /i c:\temp\OneDriveFlyoutPS.dll
- You will see a pop-up saying that it could not find the registration code, you can ignore it, as the proxy has no code only the COM proxy/stub (don't install it on Windows 11 as the COM is registered there)
- Now you can run the 64-bit version of the util
- If you want to uninstall the proxy/stub, run this in Administrator mode:
regsvr32 /u c:\temp\OneDriveFlyoutPS.dll