启用功能Windows Server 2016上的TCP激活由于父问题而失败

时间:2017-10-13 12:21:15

标签: powershell windows-server-2016

我尝试在Windows Server 2016上启用功能 TCP激活,但它失败并带有

"The request to add or remove features on the specified server failed.
Installation of one or more role, role services, or features failed. 
One or several parent features are disabled so current feature can not be enabled. 
Error: 0xc004000d"

我已经跟踪了父功能,但它们都已安装完毕 我在事件日志中找不到任何相关内容 机器刚刚重新启动。

问:什么是失败的 或者我该如何追踪它?

TL; DR

我使用Powershell跟踪 TCP激活功能,如下所示:

Get-WindowsFeature | where { $_.Name -eq 'NET-WCF-TCP-Activation45' } | select *

给了我(缩短)

...
Installed                 : False
InstallState              : Available
DependsOn                 : {NET-Framework-45-Core, NET-WCF-TCP-PortSharing45, NET-Framework-45-ASPNET, WAS-Process-Model...}
...

未安装此功能。这就是预期的结果 然后我在错误消息中找到我猜测的线索DependsOnparent feature相同。
所以我用

扩展它
Get-WindowsFeature | where { $_.Name -eq 'NET-WCF-TCP-Activation45' } | select -ExpandProperty DependsOn

让我进入

NET-Framework-45-Core
NET-WCF-TCP-PortSharing45
NET-Framework-45-ASPNET
WAS-Process-Model
WAS-Config-APIs

并通过它们迭代给我

Installed                 : True
InstallState              : Installed

每一个。

我尝试通过Powershell启用该功能,希望能够找到更多信息。

PS C:\...\> Install-WindowsFeature NET-WCF-TCP-Activation45 -Verbose
VERBOSE: Installation started... 
VERBOSE: Continue with installation?
VERBOSE: Prerequisite processing started...
VERBOSE: Prerequisite processing succeeded.
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.
One or several parent features are disabled so current feature can not be enabled. Error: 0xc004000d
At line:1 char:1
+ Install-WindowsFeature NET-WCF-TCP-Activation45
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + 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         {}     

如前所述,我在事件日志中找不到任何相关内容 还有其他日志要看吗? 机器刚刚重新启动,相当新,我只安装了SqlServer2017。 我在哪里继续?

1 个答案:

答案 0 :(得分:1)

对于那些迟到该线程的人来说,问题是必须启用Windows激活服务本身才能使其正常工作,即使未将其列为“依赖项”也是如此。然后添加其他依赖项,最后添加WCF-TCP-Activation45。

因此,要启用TCP激活,总操作如下所示。

Enable-WindowsOptionalFeature -Online -FeatureName WAS-WindowsActivationService
Enable-WindowsOptionalFeature -Online -FeatureName WAS-ProcessModel
Enable-WindowsOptionalFeature -Online -FeatureName WAS-ConfigurationAPI
Enable-WindowsOptionalFeature -Online -FeatureName WCF-TCP-Activation45

如果要启用HTTP激活,除了上面的“ TCP”替换为“ HTTP”外,如果要启用HTTP激活,这是一个额外的提示。