简体   繁体   English

作为Windows服务托管时,远程WMI不起作用

[英]Remote WMI not working when hosted as Windows Service

I am working on Remote WMI. 我正在使用远程WMI。 I have done all DCOM settings, CIMV2 and WMI settings for particular User. 我已经为特定用户完成了所有DCOM设置,CIMV2和WMI设置。 When I run the application as console app, it works fine and fetches me the data. 当我将应用程序作为控制台应用程序运行时,它可以正常工作并获取数据。 But when I host the same as Windows service, it is throwing exception as 但是,当我托管与Windows服务相同的服务时,它将引发异常

Message:  Error Message: Access is denied. 
(Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) 
Inner Exception Message:  Stack Trace:    
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)    
at System.Management.ManagementScope.InitializeGuts(Object o)    
at System.Management.ManagementScope.Initialize()    
at RemoteWMIRule.BackupServerRule..ctor()

Got Solved by adding Network and Network Service in DCOM Configurations. 通过在DCOM配置中添加网络和网络服务来解决。 But still the problem persists in Windows Server 2008 R2 OS. 但是问题仍然存在于Windows Server 2008 R2 OS中。 Anything OS specific to be done???!! 任何特定的操作系统都可以完成?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM