Error with windows 10 PowerShell Get-WindowsCapability and Add-WindowsCapability commands

Viewed 22752

I am running Windows 10 Pro 1809
I wish to install active directory on the computer; however, when I attempt to use powershell command:

Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online

I get the following error:

Add-WindowsCapability : Add-WindowsCapability failed. Error code = 0x800f0950
At line:1 char:45
+ ... WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online
+                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand

It is also worth noting the command:

Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State

Displays the following:

DisplayName                                                                          State
-----------                                                                          -----
RSAT: Active Directory Domain Services and Lightweight Directory Services Tools NotPresent
RSAT: BitLocker Drive Encryption Administration Utilities                       NotPresent
RSAT: Active Directory Certificate Services Tools                               NotPresent
RSAT: DHCP Server Tools                                                         NotPresent
RSAT: DNS Server Tools                                                          NotPresent
RSAT: Failover Clustering Tools                                                 NotPresent
RSAT: File Services Tools                                                       NotPresent
RSAT: Group Policy Management Tools                                             NotPresent
RSAT: IP Address Management (IPAM) Client                                       NotPresent
RSAT: Data Center Bridging LLDP Tools                                           NotPresent
RSAT: Network Controller Management Tools                                       NotPresent
RSAT: Network Load Balancing Tools                                              NotPresent
RSAT: Remote Access Management Tools                                            NotPresent
RSAT: Remote Desktop Services Tools                                             NotPresent
RSAT: Server Manager                                                            NotPresent
RSAT: Shielded VM Tools                                                         NotPresent
RSAT: Storage Migration Service Management Tools                                NotPresent
RSAT: Storage Replica Module for Windows PowerShell                             NotPresent
RSAT: System Insights Module for Windows PowerShell                             NotPresent
RSAT: Volume Activation Tools                                                   NotPresent
RSAT: Windows Server Update Services Tools                                      NotPresent
3 Answers

Try this:

Open Powershell with Admin permissions and add the folowing:

Set Windows Update Server Key to 0

Set-ItemProperty -Path HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name UseWUServer -Value 0

Restart Windows Update Service

Restart-Service -Name wuauserv -Force

Get RSAT Tools

Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online

Set Windows Update Server Key to 1

Set-ItemProperty -Path HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name UseWUServer -Value 1

Restart Windows Update Service

Restart-Service -Name wuauserv -Force

Done

Apparently error code 0x800f0950 means "not enough sources to install something", it's possible that one or more of RSAT tools require .NET 3.5 which requires additional sources to be installed. Please check if you have .NET 3.5 installed, then install it if not and run RSAT install again.

On my system, I did this to add the RepairContentServerSource right :

> New-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing -Name RepairContentServerSource -Type dword -Value 2

To install the specific RSAT.ActiveDirectory, type this :

> Get-WindowsCapability -Name RSAT.ActiveDirectory.* -Online | Add-WindowsCapability -Online

Path          :
Online        : True
RestartNeeded : False

To install ALL the RSAT Tools, type this :

> Get-WindowsCapability -Name RSAT.* -Online | Add-WindowsCapability -Online

Path          :
Online        : True
RestartNeeded : False

... # There are actually 21 RSAT components, so this appears 21 times

Path          :
Online        : True
RestartNeeded : False

and finally, type this :

> Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing -Name RepairContentServerSource -Type dword -Value 0 

See this document for the registry values : https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.Servicing::Servicing

Related