Windows 2022: Install-WindowsFeature fails but Server Manager GUI install works

Saf 46 Reputation points
2022-04-08T07:32:20.137+00:00

I am currently attempting to migrate services from a Windows 2016 server to Windows 2022 however, I am running into an issue when installing Windows features. For this example I will reference the feature 'RSAT-SMTP' but the same issue happens with other features.

I attempted using the command below and you can see the result:

    PS C:\Windows\system32> Install-WindowsFeature RSAT-SMTP  
Install-WindowsFeature : The request to add or remove features on the specified server failed.  
Installation of one or more roles, role services, or features failed. Error: 0x800f0922  
At line:1 char:1  
+ Install-WindowsFeature RSAT-SMTP  
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    + CategoryInfo          : InvalidOperation: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature], Exception  
    + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand  

Success Restart Needed Exit Code      Feature Result  
------- -------------- ---------      --------------  
False   No             Failed         {}  


PS C:\Windows\system32>  

When attempting to install the feature via the Server Manager GUI, it works fine:

191284-rsat-smtp.png

Researching the error code in the powershell output shows two possible options:

1) The server can't reach the WSUS site. - This is correct, the server can NOT reach the WSUS site as it does not have direct outbound access. However, it also doesn't have access when installing via server manager.
2) There is less than 500 MB free. - This is incorrect, there is over 10 GB free space.

So my question is, what is different between installing via powershell and server manager on Windows 2022? The powershell command works fine when installing on Windows server 2016

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Saf 46 Reputation points
    2023-10-30T13:07:49.7333333+00:00

    Forgot this was still open.

    The issue was resolved by installing 'microsoft-windows-netfx3-ondemand-package' prior to attempting to install features etc. After installing this there were no issues with windows feature installations.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.