Injecting Updates via Dism gives error 50 all the time

dismmdt-2013windows-server-2012-r2windows-updatewsus-offline

I am running Win 2012 R2 with MDT 2013, WDS & WSUS. trying to auto inject updates from wsus update share into my OS Wim (win 10 tech preview x64) for deployment. using this script


$UpdatesPath = "\\192.168.30.204\wsus\WsusContent"
$MountPath = "C:\SCRIPTSV2\mounter1"
$WimFile = "C:\SCRIPTSV2\TestOS2\Windows 10 Pro Technical Preview x64\sources\install.wim"
DISM /Mount-Wim /WimFile:$WimFile /index:1 /Mountdir:$MountPath
$UpdateArray = Get-Item $UpdatesPath
ForEach ($Updates in $UpdateArray)
{
DISM /image:$MountPath /Add-Package /Packagepath:$Updates
Start-Sleep –s 10
}
Write-Host "Updates Applied to WIM"
DISM /Unmount-Wim /Mountdir:$MountPath /commit
DISM /Cleanup-Wim

Whenever i run the script, it magicaly mounts the image to C:\WorkDir\Mount, when mounted im getting Error Code 50:

to service this windows image requires the latest version of the dism.

for every update the script tries to apply, So okay i thought that i could maybe use the DISM provided in the target WIM , so i patched all the dism.exe sources in my Win 2012 R2 server with dism 10.0.9933. But still no luck!

How can i fix this problem?
Thanks in advance,
Bram

Edit: I even replaced dismcore.dll from the System32 with the install media one. now running dism.exe version 10.0.9933 with dismcore.dll from a same OS release.

Best Answer

We are doing slightly different things with our images (you are scripting, I'm just doing straight WDS images), but I'm hoping I can point you in the right direction.

I was having the exact same issue that you are seeing, but I was just trying to run Dism from the command line on my 2012 R2 WDS box. I tried to manually change the Dism.exe in \windows\system32, but that also failed.

I ended up finding out that I needed to install the Windows 10 ADK: https://blogs.technet.microsoft.com/yongrhee/2015/08/11/download-windows-10-assessment-and-deployment-kit-adk/

Once I installed the ADK, and I launched the Dism from the "Deployment and Imaging Tools Environment" that comes with the ADK, I was able to add the drivers to my wim file. I hope in some way that helps you out.

Related Topic