FIX: Windows Defender Feature Installation Failed–Source files could not be found in Server 2016 (Solved)
This tutorial contains instructions to resolve the following problem in Server 2016: "Windows Defender Feature Installation Failed. Source files could not be found".
After removing the Windows Defender feature and the payload, on a Windows Server 2016, by using the "Dism /online /Disable-Feature /FeatureName:Windows-Defender /Remove /NoRestart /quiet" command, it's impossible to install the Windows Defender feature again. The problem remains even if you define an offline image, as an alternate source path, either in 'Add Roles and Features' wizard or in the DISM command: "DISM /Online /Enable-Feature /FeatureName:Windows-Defender /Source:X:\Sources\Install.wim".
How to FIX: Windows Defender Feature Installation Failed – 0x800f081f on Server 2016
1. Place the Windows Server 2016 installation Media on the server. *
* Note: If you don't own the Windows Server 2016 Installation media, then download the media in an ISO file and then mount the ISO. Keep in mind that you have to mount an image of the exact same version and build of the Windows Server 2016 that you want to repair.e.g. If you 're running the 1607 version, you need the 1607 version in an ISO file.
2. Create the following two (2) folders on the root of C: drive:
1. mountdir
2. msu
3. Launch Command Prompt as Administrator and give the following command, to list all the Windows Server 2016 versions that included in the 'install.wim' file.: *
- dism /Get-WimInfo /WimFile:X:\sources\install.wim
* Note: Where X = the drive letter of the Windows Server 2016 install media or the mounted ISO file. e.g. if the install media is on drive H: type:
- dism /Get-WimInfo /WimFile:H:\sources\install.wim
4. Find out the Index number of the installed Server 2016 edition.*
* e.g.: If you have installed the "Windows Server 2016 Standard with the Desktop Experience", then the index number is 2.
5. Then give the command below to extract the corresponding to your Windows Server 2016 version "install.wim" file (Index number): *
- dism /export-image /SourceImageFile:X:\sources\install.wim /SourceIndex:IndexNumber /DestinationImageFile:C:\install.wim /Compress:max /CheckIntegrity
* Note: Replace at the above command the drive letter and the IndexNumber according to your case.
e.g. For this example we want to extract the install.wim file with Index number=2 (Windows Server 2016 Standard) to the root of the "C:\" drive (C:\install.wim). So, the command will be:
-
dism /export-image /SourceImageFile:H:\sources\install.wim /SourceIndex:2 /DestinationImageFile:C:\install.wim /Compress:max /CheckIntegrity
6. When the extraction is completed, proceed and remove the 'Read Only' attribute from the extracted 'install.wim' file, by giving this command:
- attrib.exe -r C:\install.wim
7. Now, mount the extracted install.wim image to "C:\mountdir" folder, with this DISM command:
- dism.exe /mount-wim /WimFile:C:\install.wim /index:1 /mountDir:c:\mountdir
8. give the following command to see the installed Server version.
- winver
9. According to the installed version, navigate to Microsoft Update Catalog and download the corresponding cumulative update for your Server 2016 version/build* and then place the update into the "C:\MSU" folder.
* e.g. If you have the 1607 version, proceed and download the KB4103720 update.
10. When the download is complete, proceed and update the mounted offline Windows image (at "C:\mountdir" folder) with the downloaded update (from "C:\MSU" folder), by giving this command:
- Dism /Add-Package /Image:C:\mountdir\ /PackagePath:C:\MSU\Update-Name.msu /LogPath:AddPackage.log
* Note: In the above command change the "Update-Name" with the name of the downloaded update. For example: if you have downloaded the KB4103720 update, the command will be:
- Dism /Add-Package /Image:C:\mountdir\ /PackagePath:C:\MSU\windows10.0-kb4103720-x64_c1fb7676d38fffae5c28b9216220c1f033ce26ac.msu /LogPath:AddPackage.log
11. When the operation is completed, open Task Manager and close the Explorer.exe task. (this is important otherwise you 'll receive the error "the directory could not be completely unmounted" at the next step).
12. Give the following command to commit the changes back to the offline "C:\install.wim" image and to unmount it. *
-
Dism /Unmount-WIM /MountDir:C:\mountdir /Commit
13. When the changes are committed back, open Task Manager again and from the File menu, choose Run New Task, type explorer.exe and hit OK.
14. Finally, give the following command to install the Windows Defender feature in Server 2016:
- Dism /Online /Enable-Feature /FeatureName:Windows-Defender /all /source:WIM:C:\install.wim:1 /LimitAccess
15. Close all windows and restart your server to apply changes.
That’s all folks! Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.
JDub
April 15, 2021 @ 8:24 pm
Thank you for this article!
For anyone that runs across this article and cant get it working. Make sure you are using the RTM ISO.
George
September 11, 2020 @ 11:46 pm
Great!
Finally I resolved the issue with enabling Defender!
I also needed to install the correspond Servicing Stack Update for Windows Server 2016 for x64-based Systems first.
And then the Windows Server 2016 for x64 cumulative update.
Thank you so much!!!
mike
May 23, 2020 @ 10:58 am
thank for your tutorial
To get the new MSU package working you have to first merge the latest build of "Servicing Stack Update"
Or you will get a failure with Error: 0x800f0823
https://www.catalog.update.microsoft.com/Search.aspx?q=KB4550994
Now I have updated to windows10.0-kb4556813-x64
marc
September 2, 2019 @ 9:27 pm
C:\WINDOWS\system32>Dism /Online /Enable-Feature /FeatureName:Windows-Defender /all /source:WIM:C:\install.wim:1 /LimitAccess
Deployment Image Servicing and Management tool
Version: 10.0.14393.3085
Image Version: 10.0.14393.3085
Enabling feature(s)
[==========================100.0%==========================]
Error: 0x800f081f
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
lakonst
September 3, 2019 @ 9:43 am
Use the instructions at this method (NLITE) to extract the install.wim file and try the procedure again.
BaBaVick
July 23, 2023 @ 6:38 am
After using NLITE to extract the install.wim file, do all the commands again, the same way? Or change all the references of .wim to .esd?
lakonst
July 24, 2023 @ 9:15 am
If you have "install.esd", then yes you have to change the reference of "install.wim" to "install.esd"