Skip to content

Instantly share code, notes, and snippets.

@s1carii
Last active March 20, 2025 16:39
Show Gist options
  • Save s1carii/d668283e68f5fc42754e9e082a5e78ce to your computer and use it in GitHub Desktop.
Save s1carii/d668283e68f5fc42754e9e082a5e78ce to your computer and use it in GitHub Desktop.
1809 RSAT and OpenSSH Installation with "Add-WindowsCapability failed. Error code = 0x800f0954" Workaround
# https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
# If WSUS doesn't have the FODs you have to temporarily disable updates from the WSUS endpoint in the registry
$currentWU = Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" | select -ExpandProperty UseWUServer
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 0
Restart-Service wuauserv
# Install the OpenSSH Client and Server
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# This will break if you don't have the right .NET installed (lookin' at you Win10 Server)
# Install all publicly-available RSAT features
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online
# "Reconnect" the registry to the WSUS endpoint
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value $currentWU
Restart-Service wuauserv
# Initial Configuration
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the Firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment