Sysprep DscCore.dll error on Windows 10 Multi-session Build 2004

I was testing out the new Azure Windows Virtual Desktop (WVD) ARM deployment model with Windows 10 Enterprise multi-session 2004 build.
Part of the deployment involves running sysprep to prepare a new gold image for Windows 10. However, when running sysprep from Windows Run command line, it fails without displaying any errors.

Looking through the sysprep log file located in C:\Windows\System32\Sysprep\Panther\setuperr.log displays the following errors:

2020-09-15 01:38:07, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing ‘DscCore.dll,SysPrep_Cleanup’, returned error code 0x2
2020-09-15 01:38:07, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x2[gle=0x00000006]
2020-09-15 01:38:07, Error [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x80070002[gle=0x00000006]

The fix for this is to follow the instructions at Microsoft’s website which involves the following:

Delete the panther directory (C:\Windows\Panther). Then change the directory to %windir%\system32\sysprep, and then run sysprep.exe.

Select “Generalize” and select Shutdown to stop the VM once sysprep has completed.

One Responseso far.

  1. Tim says:

    Possible solution is

    reg add “HKLM\SOFTWARE\Microsoft\DesiredStateConfiguration” /v AgentId /t REG_SZ /d “” /f

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.