rodneyviana / ODSyncUtil

MIT License
14 stars 5 forks source link

No Result or Error when run on Windows 10 22H2 #19

Closed SynapseCarbon closed 1 month ago

SynapseCarbon commented 5 months ago

Hi,

I'm trying to use the util on a new VM built running W10 Pro 22H2 (19045.4291) x64. Patched and PowerShell 7 installed.

Downloaded the 64 bit version of ODSyncUtil Unblocked the Zip file prior to extraction

.\Get-ODStatus.ps1 returns no output. .\Get-ODStatusFromDLL.ps1 returns:

MaxSize: 4096 / Type: ulong
MethodInvocationException: C:\Scripts\Test\Get-ODStatusFromDLL.ps1:42
Line |
  42 |      $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "GetODSyncStatus" with "4" argument(s): "Value cannot be null. (Parameter 'path1')"
Write-Error: Call to GetODSyncStatus failed. HRESULT:
Write-Error: Size: 0

            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size

I have downloaded OneDriveFlyOutPS.dll, unblocked and run (from a elevated command prompt):

regsvr32 /i OneDriveFlyOutPS.dll

This returns (which I think is expected):

image

Running ODSyncUtil -d directly returns:

2024-04-25 10:08:46.531: Command line arguments parsed
2024-04-25 10:08:46.531: Save file name:
2024-04-25 10:08:46.531: Is debug: 1
2024-04-25 10:08:46.531: Ignore quota: 0
2024-04-25 10:08:46.547: CoInitialize succeeded
2024-04-25 10:08:46.547: SyncRootReader created
2024-04-25 10:08:46.547: EnumerateSubKeys returned 1 keys
2024-04-25 10:08:46.547: Getting status for OneDrive!S-1-5-21-<Redacted>!Personal|<Redacted>
2024-04-25 10:08:46.547: SID: S-1-5-21-1142031330-50991386-3478808051-1001
2024-04-25 10:08:46.547: User: <PCName>\Chris
2024-04-25 10:08:46.547: Type: Personal
2024-04-25 10:08:46.547: Current User SID: S-1-5-21-<Redacted>
2024-04-25 10:08:46.547: CoCreateInstance Storage Provider for OneDrive: 0x80040154
2024-04-25 10:08:46.547: getInstanceStatus returned 0x80040154
2024-04-25 10:08:46.547: SyncRootReader deleted
2024-04-25 10:08:46.547: serializeStateVector returned 2 characters
[]

Have I missed a step somewhere?

I have also tried the original utility which works from an interactive PowerShell session but that fails when non-interactive.

Thanks, Chris.

SynapseCarbon commented 5 months ago

I'm not sure what I did as when I posted this I couldn't get anything to work, then last night I suddenly got a full output, either directly from the .exe (though only when run from inside PS).

My new problem is I was hoping to get the OneDrive status by calling the PS script from a monitoring tool (which has a local agent on the VM). When I do that, no status is returned which I presume is because the script is running non-interactively.