I will show you how to convert ESD (Electronic Software Download) to WIM file.
1- Create a new folder in the C:\ drive for example C:\ESD
2- Mount your Window ISO ( in my case I’m doing these steps on my VirtualBox)
3- Locate the Install.esd file in the ISO ( D:\Sources\install.esd)
4- Copy the file in the folder (C:\ESD)
5- Open the Command Prompt as an Admin & change the directory to where you have the Install.esd file
6- Run the following command: dism /Get-WimInfo /WimFile:install.esd
7- Pick which Operating System (I picked 6) you want then run the following command: dism /export-image /SourceImageFile:install.esd /SourceIndex:6 /DestinationImageFile:Install.wim /Compress:max /CheckIntegrity
8- Now you made yourself a WIM file & you can use it for MDT or SCCM to create your custom image.