为什么对OCS服务器的远程WMI调用失败? [英] Why do the Remote WMI calls to OCS Server fails?

查看:82
本文介绍了为什么对OCS服务器的远程WMI调用失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么对OCS R2服务器的远程WMI调用失败? (详情如下)。我错过了OCS服务器上的任何设置吗?


< font face = Calibri>



我正在尝试从远程PC读取MSFT_SIPTrustedAddInServiceSetting的实例请求失败并出现Win32错误"发生了操作错误。"。我试图读取大多数OCS R2提供程序类并获得相同的错误,同时我能够读取系统提供的类(MSFT_Providers工作正常)。在'OCS R2系统'(本地WMI)上尝试此操作时,它运行良好。



设置:


· < font face = Calibri>'OCS R2系统'和'WMI客户端PC'在同一个域中,'WMI客户端PC'登录,域用户是'OCS R2系统'的本地管理员


· 我使用的工具'wbemtest'和'WMI CIM Studio'尝试上述操作


· 还写了一个WMI客户端应用程序在下面的步骤5中失败


1。 CoInitializeSecurity


2. CoCreateInstance(IWbemLocator)


3. < span style ="font:7pt'Times New Roman'"> IWbemLocator-> ConnectServer(OCS服务器,OCS管理员用户,密码, ...,IWbeServices)


4. IWbemServices-> ExecuteQuery(WQL,"Select * from MSFT_SIPTrustedAddInServiceSetting",...,IEnumWbemClassObject)


5. IEnumWbemClassObject-> Next(......,IWbemClassObject)


6. IWbemClassObject-> Get (PropertyName,PropertyValue)


解决方案




我有他完全相同的问题,在安装了OCS R2的主机上一切正常,但从远程PC访问WMI会出现以下异常。

(HRESULT异常:0x80072020)
/> at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode,IntPtr errorInfo)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at System.Management.ManagementObjectCollection.get_Count()





string wmiQuery = " SELECT * FROM MSFT_SIPTrustedAddInServiceSetting WHERE TYPE = \" ;" + name + " \"" ;



ObjectQuery query = new ObjectQuery (wmiQuery);



我正在设置连接和管理范围的用户名,密码,名称为i n上面的查询字符串是我的应用程序的名称。

当我遍历 ManagementObjectCollection

Why do the Remote WMI calls to OCS R2 Server fails? (Details below). Am I missing any setup on the OCS server?

 

I’m trying to read the instances of MSFT_SIPTrustedAddInServiceSetting from an remote PC and the request fails with a Win32 error "An operations error occurred.". I tried to read most of the OCS R2 provider classes and getting the same error while I’m able to read class provided by the system (MSFT_Providers works fine). When tried this operation on the ‘OCS R2 system’ (Local WMI) it works well.

 

Setup:

·         ‘OCS R2 system’ and ‘WMI Client PC’ are in the same domain and the ‘WMI client PC’ login with a domain user who is a local administrator on ‘OCS R2 system’

·         I used the tools ‘wbemtest’ and ‘WMI CIM Studio’ to try the above operation

·         Also wrote a WMI client application and it fails in step 5 below

1.       CoInitializeSecurity

2.       CoCreateInstance( IWbemLocator )

3.       IWbemLocator->ConnectServer( OCS Server, admin user on OCS, password, ……, IWbeServices)

4.       IWbemServices->ExecuteQuery(WQL, "Select * from MSFT_SIPTrustedAddInServiceSetting",…., IEnumWbemClassObject)

5.       IEnumWbemClassObject->Next(……, IWbemClassObject)

6.       IWbemClassObject->Get(PropertyName,PropertyValue)

 

解决方案


Hi,

I'm having the exact same issue, everything works fine on the host with OCS R2 installed, but accessing the WMI from a remote PC give the following exception.

(Exception from HRESULT: 0x80072020)

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at System.Management.ManagementObjectCollection.get_Count()


 

string wmiQuery = "SELECT * FROM MSFT_SIPTrustedAddInServiceSetting WHERE TYPE = \"" + name + "\"";

 

ObjectQuery query = new ObjectQuery(wmiQuery);


I'm setting the username, password for the connection and management scope, name in the above query string is the name of my application.

The exception is raised when i iterate over the  ManagementObjectCollection returned from the above query.


这篇关于为什么对OCS服务器的远程WMI调用失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆