【问题标题】:Error with windows 10 PowerShell Get-WindowsCapability and Add-WindowsCapability commandsWindows 10 PowerShell Get-WindowsCapability 和 Add-WindowsCapability 命令出错
【发布时间】:2018-12-24 21:26:42
【问题描述】:

我正在运行 Windows 10 Pro 1809
我希望在计算机上安装活动目录;但是,当我尝试使用 powershell 命令时:

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

我收到以下错误:

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

还有一个值得注意的命令:

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

显示以下内容:

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

【问题讨论】:

标签: powershell active-directory windows-10


【解决方案1】:

试试这个:

使用管理员权限打开 Powershell 并添加以下内容:

将 Windows 更新服务器密钥设置为 0

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

重启 Windows 更新服务

Restart-Service -Name wuauserv -Force

获取 RSAT 工具

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

将 Windows 更新服务器密钥设置为 1

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

重启 Windows 更新服务

Restart-Service -Name wuauserv -Force

完成

【讨论】:

  • 错误:“重新启动服务:服务 'Windows Update (wuauserv)' 由于以下错误而无法启动:无法在计算机 '.' 上启动服务 wuauserv。”
  • 对我来说效果很好。不知道 WSUS 会在安装可选功能时发挥作用。这个小宝石进入了我的工具包。
  • 感谢您的建议,我最近在安装 OpenSSH Server 时遇到了类似的问题。我听从了您的建议,并将步骤“获取 RSAT 工具”替换为 Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
【解决方案2】:

显然错误代码 0x800f0950 的意思是“没有足够的资源来安装 something”,一个或多个 RSAT 工具可能需要 .NET 3.5,这需要安装额外的资源。请检查您是否安装了 .NET 3.5,如果没有安装它并再次运行 RSAT 安装。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-01
    • 2020-02-05
    • 1970-01-01
    • 2016-05-27
    • 2018-01-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多