问题描述
在Win8.1(使用 Powershell Core 6 + )中显示服务时,我遇到了一个从未见过的问题。在Admin Shell中运行Get-Service
,会导致以下错误:
$ Get-Service
...
Get-Service : Service 'NetTcpPortSharing (NetTcpPortSharing)' cannot be queried due to the following error:
At line:1 char:1
+ Get-Service
+ ~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (System.ServiceProcess.ServiceController:ServiceController) [Get-Service],ServiceCommandException
+ FullyQualifiedErrorId : CouldNotGetServiceInfo,Microsoft.PowerShell.Commands.GetServiceCommand
Stopped NetTcpPortSharing NetTcpPortSharing
...
查看此服务的详细信息,我会看到:
然后使用net helpmsg 15101
我得到了:
The resource loader failed to load MUI file because the file fail to pass validation.
我不知道这是什么意思,即使它与说明字段中显示的内容相关。
因此,这些信息都没有道理,我也不知道是什么创建了此服务,也不知道它在做什么或正在使用它。但是我知道几天前我没有这个问题,但是我不知道我是否有这项服务。我一直在玩各种 Remoting 功能,但是从这台机器到另一个W10。
NetTcpPortSharing的用途是什么,我可以安全地删除它吗?
(它通常来自哪里?)
可能相关的参考文献:
- NetTcpPortSharing
- Access denied when using Net.Tcp Port Sharing Service
- Windows Service is giving Description: <Failed to read description error code 2>
更新(根据magicandre1981)
# $key = 'HKLM:\SYSTEM\CurrentControlSet\Services\NetTcpPortSharing'
# Get-ItemProperty -Path $key
DisplayName : NetTcpPortSharing
ErrorControl : 1
ImagePath : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SMSvcHost.exe
Start : 4
Type : 32
Description : @%systemroot%\Microsoft.NET\Framework64\v4.0.30319\ServiceModelInstallRC.dll,-8200
ObjectName : NT AUTHORITY\LocalService
ServiceSidType : 3
RequiredPrivileges : {SeCreateGlobalPrivilege}
FailureActions : {132,3,0...}
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetTcpPortSharing
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
PSChildName : NetTcpPortSharing
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
为此的配置文件位于:
# find //c/Windows/Microsoft.NET/Framework*/ -iname "SMSvcHost.exe.config"
//c/Windows/Microsoft.NET/Framework/v4.0.30319/SMSvcHost.exe.config
//c/Windows/Microsoft.NET/Framework64/v4.0.30319/SMSvcHost.exe.config
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)