Problems with installing OpenSSH on win11

Yasir Khan 25 Omdømmepoeng
2025-10-15T09:10:31.69+00:00

Trying to install OpenSSH on windows 11. Tried installing it from optional functions and also by powershell, but getting errors. Also missing the ssh folder in programdata. Hope someone has the solution.

When trying this command:

Add-WindowsCapability -Name OpenSSH.Server~~~~0.0.1.0 -Online

Getting error:

Add-WindowsCapability : Add-WindowsCapability failed. Error code = 0x800f0950

At line:1 char:1

  • Add-WindowsCapability -Name OpenSSH.Server~~~~0.0.1.0 -Online
  • 
        + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    
        + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand
    
Windows for home | Windows 11 | Installasjon og oppgradering
0 kommentarer Ingen kommentarer

Svar godtatt av spørsmålsforfatter
Ian-T 13,450 Omdømmepoeng Eksternt personale hos Microsoft Moderator
2025-10-17T13:45:37.69+00:00

Please note that this is Norwegian Q&A Forum, any threads should be posted in Norwegian. However, I will still provide an answer on English based on your initial response. 

Hello Yas-3040,

Thank you for reaching out to Microsoft Q&A forum  

Regarding to your concern, based on my knowledge, The error code 0x800f0950 typically occurs when Windows is unable to download the necessary files for an optional feature such as the OpenSSH Server. This issue is commonly caused by: 

  • Group Policy restrictions (such as systems configured to use WSUS instead of Windows Update), 
  • Network connectivity issues, 
  • Missing system updates. 

Additionally, the absence of the C:\ProgramData\ssh directory is expected if OpenSSH has not been installed yet. This folder is created only upon successful installation. 

Therefore, I think you can first try the following methods to see if the issue gets resolved. I’m truly sorry to say that the approach I’m suggesting below is based on surveys and my own experience. As a forum moderator, I don’t have extensive access or resources, so sometimes the solutions I provide may not resolve the issue immediately. 

However, if the problem still persists after you’ve tried the methods I suggested, please feel free to let me know in the comments section so I can continue to support you. 

1. Ensure the Operating System is Fully Updated 

In many cases, an outdated version of Windows can prevent optional features from being installed. 

  1. Open Settings > Windows Update. 
  2. Click Check for updates. 
  3. Install all available updates, including any optional ones. 
  4. Restart the computer. 

After the system restarts, attempt to install OpenSSH Server: 

  • Using the graphical interface:  Navigate to Settings > System > Optional Features > Add a feature, search for "OpenSSH Server", and select Install. 
  • Using PowerShell (with Administrator privileges): 1. Ensure the Operating System is Fully Updated  In many cases, an outdated version of Windows can prevent optional features from being installed. 
    1. Open Settings > Windows Update. 
    2. Click Check for updates. 
    3. Install all available updates, including any optional ones. 
    4. Restart the computer. 

After the system restarts, attempt to install OpenSSH Server: 

  • Using the graphical interface: 
    Navigate to Settings > System > Optional Features > Add a feature, search for "OpenSSH Server", and select Install. 
  • Using PowerShell (with Administrator privileges): 
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 

2. Temporarily Bypass WSUS Using PowerShell 

If the system is connected to a corporate network or domain environment that uses WSUS (Windows Server Update Services), this may prevent the system from downloading required files from Microsoft servers. The following PowerShell script disables the WSUS setting temporarily, installs OpenSSH Server, and then restores the original configuration. 

Steps: 

Run the following PowerShell script as Administrator: 

$UseWUServer = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -ErrorAction SilentlyContinue 
  
If ($null -ne $UseWUServer -and $UseWUServer -eq 1) { 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 0 
    Restart-Service wuauserv 
} 
  
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 
  
If ($null -ne $UseWUServer -and $UseWUServer -eq 1) { 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 1 
    Restart-Service wuauserv 
} 

Please feel free to let me know if you need any further assistance.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  

Var dette svaret nyttig?

1 person syntes dette svaret var nyttig.
0 kommentarer Ingen kommentarer

0 tilleggssvar

Sorter etter: Nyeste

Svaret ditt

Svar kan merkes som «Godtatt» av spørsmålsforfatteren og «Anbefalt» av moderatorer, noe som hjelper brukerne med å vite at svaret løste forfatterens problem.