chkdsk on remote host with Invoke-Command always fails with "An unspecified error occurred" message

ssw 1 Reputation point
2021-11-04T04:34:10.93+00:00

Hi,

I want to execute "chkdsk" on multiple windows servers and tried to use powershell Invoke-Command but it always fails.

D:\>powershell -Command "Invoke-Command -ComputerName <local host/remote host> -ScriptBlock {chkdsk C:}"
-> NOK

Stage 2: Examining file name linkage ...
Progress: 25471 of 315096 done; Stage: 8%; Total: 25%; ETA: 0:00:20 .
Progress: 77957 of 315096 done; Stage: 24%; Total: 30%; ETA: 0:00:17 ..
Progress: 135370 of 315096 done; Stage: 42%; Total: 35%; ETA: 0:00:14 ...
Progress: 200120 of 315096 done; Stage: 63%; Total: 42%; ETA: 0:00:12
Progress: 228157 of 315096 done; Stage: 72%; Total: 45%; ETA: 0:00:11 .
Progress: 229522 of 315096 done; Stage: 72%; Total: 48%; ETA: 0:00:11 ..
Progress: 229634 of 315096 done; Stage: 72%; Total: 49%; ETA: 0:00:11 ...
Progress: 230444 of 315096 done; Stage: 73%; Total: 50%; ETA: 0:00:11
Progress: 230762 of 315096 done; Stage: 73%; Total: 55%; ETA: 0:00:11 .
Progress: 231367 of 315096 done; Stage: 73%; Total: 56%; ETA: 0:00:09 ..
Progress: 233138 of 315096 done; Stage: 73%; Total: 56%; ETA: 0:00:09 ...
Progress: 234857 of 315096 done; Stage: 74%; Total: 57%; ETA: 0:00:09
Progress: 236015 of 315096 done; Stage: 74%; Total: 57%; ETA: 0:00:09 .
Progress: 237377 of 315096 done; Stage: 75%; Total: 57%; ETA: 0:00:09 ..
Progress: 239297 of 315096 done; Stage: 75%; Total: 58%; ETA: 0:00:09 ...
Progress: 239783 of 315096 done; Stage: 76%; Total: 58%; ETA: 0:00:09
Progress: 240292 of 315096 done; Stage: 76%; Total: 61%; ETA: 0:00:09 .
Progress: 240296 of 315096 done; Stage: 76%; Total: 70%; ETA: 0:00:09 ..
Progress: 240564 of 315096 done; Stage: 76%; Total: 70%; ETA: 0:00:07 ...
Progress: 242662 of 315096 done; Stage: 77%; Total: 71%; ETA: 0:00:07
Progress: 245375 of 315096 done; Stage: 77%; Total: 72%; ETA: 0:00:07 .
Progress: 246335 of 315096 done; Stage: 78%; Total: 73%; ETA: 0:00:07 ..
Progress: 247968 of 315096 done; Stage: 78%; Total: 73%; ETA: 0:00:07 ...
Progress: 249046 of 315096 done; Stage: 79%; Total: 73%; ETA: 0:00:07
Progress: 249697 of 315096 done; Stage: 79%; Total: 74%; ETA: 0:00:07 .
Progress: 250636 of 315096 done; Stage: 79%; Total: 74%; ETA: 0:00:07 ..
Progress: 251836 of 315096 done; Stage: 79%; Total: 75%; ETA: 0:00:07 ...
Progress: 253298 of 315096 done; Stage: 80%; Total: 76%; ETA: 0:00:07
Progress: 256013 of 315096 done; Stage: 81%; Total: 76%; ETA: 0:00:07 .
Progress: 258232 of 315096 done; Stage: 81%; Total: 77%; ETA: 0:00:07 ..
Progress: 258861 of 315096 done; Stage: 82%; Total: 77%; ETA: 0:00:07 ...
Progress: 259880 of 315096 done; Stage: 82%; Total: 77%; ETA: 0:00:07
Progress: 262644 of 315096 done; Stage: 83%; Total: 78%; ETA: 0:00:07 .

An unspecified error occurred (696e647863686b2e 136a).

Just running "chkdsk C:" on each hosts are fine.

Any ideas to fix this?

Thanks and Best regards,

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SChalakov 10,576 Reputation points MVP Volunteer Moderator
    2021-11-04T08:56:39.183+00:00

    Hi @ssw ,

    I suppose it could be in conjunction with the Remote Access..I serached a bit and found something interesting here:
    CHKDSK /F fails with An unspecified error occurred

    https://www.tenforums.com/performance-maintenance/129008-chkdsk-f-fails-unspecified-error-occurred.html

    It only fails if I have ransomware protection (aka controlled folder access) turned on in Windows Defender!

    (which I do on all my machines)

    So it could be that it runs locally, but is somehow blocked by Windows Defender or another AV Software when run remotelly.

    Can you pleae try to ruke this out?


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Regards,
    Stoyan

    0 comments No comments

  2. Limitless Technology 39,916 Reputation points
    2021-11-04T20:48:22.993+00:00

    Hello @ssw

    It is not recommended to invoke commands such as CHKDSK from Powershell, use instead "Repair Volume":

    https://learn.microsoft.com/en-us/powershell/module/storage/repair-volume?view=windowsserver2019-ps

    Hope this helps with your query,

    ----------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.