Pages

Saturday, October 25, 2014

Attempting to use PowerShell’s Add-Windows feature for .NET Framework 4.5 fails on a Windows Server 2012 R2 server

Problem

You have a new server installed with Windows Server 2012 R2 and need to install .NET Framework 4.5 with other roles and features so you mount the Windows Server 2012 R2 media, launch Windows PowerShell then execute the following cmdlet:

Add-WindowsFeature RSAT-ADDS,NET-Framework-45-Core, NET-WCF-HTTP-Activation45,Windows-Identity-Foundation,Web-Static-Content,Web-Default-Doc,Web-Http-Errors,Web-ASP-NET,Web-ASP-NET45,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Log-Libraries,Web-Http-Tracing,Web-Windows-Auth,Web-Filtering,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Console,Web-Scripting-Tools,Web-Client-Auth,server-media-foundation,MSMQ-Server,MSMQ-Directory -Source D:\sources\sxs

image

The installer executes and begins the install but quickly fails with the following message:

Windows PowerShell

Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> Add-WindowsFeature RSAT-ADDS,NET-Framework-45-Core, NET-WCF-HTTP-Activation45,Windows-Identity-Foundation,Web-Static-Content,Web-Default-Doc,Web-Http-Errors,Web-ASP-NET,Web-ASP-NET45,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Log-Libraries,Web-Http-Tracing,Web-Windows-Auth,Web-Filtering,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Console,Web-Scripting-Tools,Web-Client-Auth,server-media-foundation,MSMQ-Server,MSMQ-Directory -Source D:\sources\sxs

Add-WindowsFeature : The request to add or remove features on the specified server failed.

Installation of one or more roles, role services, or features failed.

The source files could not be downloaded.

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. Error: 0x800f0906

At line:1 char:1

+ Add-WindowsFeature RSAT-ADDS,NET-Framework-45-Core, NET-WCF-HTTP-Activation45,Wi ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],

Exception

+ FullyQualifiedErrorId : DISMAPI_Error__Cbs_Download_Failure,Microsoft.Windows.ServerManager.Commands.AddWindowsF

eatureCommand

Success Restart Needed Exit Code Feature Result

------- -------------- --------- --------------

False No Failed {}

PS C:\Windows\system32>

image

Solution

This issue actually got me scratching my head for quite a bit of time because the error appeared to suggest that there was something wrong with the source files.  Executing this cmdlet or using the Add Roles and Features Wizard did not allow me to successfully install the components I needed for a Lync Server 2013 install I was doing and copying the source files from the Windows Server 2012 R2 media directly onto the server did not work either.  A bit of searching on the suggested to try getting the install.wim Index number with a cmdlet such as:

dism /get-wiminfo /wimfile:d:\sources\install.wim

… then pipe in the Windows Server 2012 R2 version into the Add-WindowsFeature cmdlet:

PS D:\sources\sxs> Add-WindowsFeature RSAT-ADDS,NET-Framework-45-Core, NET-WCF-HTTP-Activation45,Windows-Identity-Foundation,Web-Static-Content,Web-Default-Doc,Web-Http-Errors,Web-ASP-NET,Web-ASP-NET45,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Log-Libraries,Web-Http-Tracing,Web-Windows-Auth,Web-Filtering,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Console,Web-Scripting-Tools,Web-Client-Auth,server-media-foundation,MSMQ-Server,MSMQ-Directory -Source

win:d:\sources\install.wim:2

Add-WindowsFeature : The request to add or remove features on the specified server failed.

Installation of one or more roles, role services, or features failed.

The source files could not be downloaded.

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. Error: 0x800f0906

At line:1 char:1

+ Add-WindowsFeature RSAT-ADDS,NET-Framework-45-Core, NET-WCF-HTTP-Activation45,Wi ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature],

Exception

+ FullyQualifiedErrorId : DISMAPI_Error__Cbs_Download_Failure,Microsoft.Windows.ServerManager.Commands.AddWindowsF

eatureCommand

Success Restart Needed Exit Code Feature Result

------- -------------- --------- --------------

False No Failed {}

PS D:\sources\sxs> Dism /get-wiminfo /wimfile:d:\sources\install.wim

… but this did not work either.  After a bit of searching, I finally realized that the reason why I was getting this error was because of the following installed security update:

Security Update for Microsoft Windows (KB2966828)

image

The same cmdlet that continuously failed completed successfully once I removed this security update:

PS D:\sources\sxs> Add-WindowsFeature RSAT-ADDS, Web-Server, Web-Static-Content, Web-Default-Doc, Web-Http-Errors, Web-Asp-Net, Web-Net-Ext, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Basic-Auth, Web-Windows-Auth, Web-Client-Auth, Web-Filtering, Web-Stat-Compression, Web-Dyn-Compression, NET-WCF-HTTP-Activation45, Web-Asp-Net45, Web-Mgmt-Tools, Web-Scripting-Tools, Web-Mgmt-Compat, Desktop-Experience, Windows-Identity-Foundation, Telnet-Client, BITS -Source d:\sources\sxs

Success Restart Needed Exit Code Feature Result

------- -------------- --------- --------------

True Yes SuccessRest... {Background Intelligent Transfer Service (...

WARNING: You must restart this server to finish the installation process.

WARNING: Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is

automatically updated, turn on Windows Update.

PS D:\sources\sxs>

image

image

image

I haven’t actually encountered the issue on a Windows Server 2012 R1 server but the following TechNet blog indicates that Security Update For Microsoft Windows 2966827 can cause the same issue as well.

Attempting to Install .NET Framework 3.5 on Windows Server 2012 R2 Fails with Error Code 0x800F0906 or “the source files could not be downloaded”, even when supplying source
http://blogs.technet.com/b/askpfeplat/archive/2014/09/29/attempting-to-install-net-framework-3-5-on-windows-server-2012-r2-fails-with-error-code-0x800f0906-or-the-source-files-could-not-be-downloaded-even-when-supplying-source.aspx

2 comments:

crack software said...

I am also facing this problem ...... thanks for this help....
crack software | free download

M@fiotU' said...

worked like a charm . have a good one mate . cheers