Below is an how to that I use at work, I have over 80 windows lab machines that I do a fresh install of windows on every 6 months-year. This is infrequent enough that I have to re-figure it out every time.
Install windows on a computer, and install other apps, and change windows settings to the way that you want them.
Remove the HD and copy it to an identical HD. (There are devices available for about $20 that will do it.)
Install the duplicated HD on the computer. (Set aside the original HD because there is a limit on the number of times that SysPrep can be ran)
Start the computer normally. There may be some complaints about switching HDs, but it should be OK.
Open CMD.
Run SysPrep from C:\Windows\System32\sysprep
sysprep /generalize /OOBE /Shutdown
Generalize resets the SIDs, event logs.
Audit has the computer start in "Audit mode" before the OOBE stuff. This would require more work for me, and I do most of this in the MDT Scripts. And it doesn't appear to work correctly.
MS on sysprep https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview
Shutdown because I need to boot from an alternative source to image the machine.
Boot using image created in MDT
Go to command prompt.
Use Net use
to map the deployment share from the MDT computer.
Use Net use
to map the deployment share for the network share where the image will be stored.
Use DISM to capture the image.
Microsoft on DISM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview
Dism /Capture-Image /ImageFile:SaveLocation.wim /CaptureDir:HD-Root /Name:”Image name”
In my case it was:
DISM /capture-Image /Imagefile:t:cap.wim /captureDir:e:\ /name:"Dec2017"
I usually use date for Image Name, unless I'm making a factulty/staff image and a lab computer image.