# query Windows machien to fetch Wbem classes

**URL:** <https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468>\
**Category:** Forum\
**Tags:** Mainframe-Integration, EntireX-DCOM\
**Created:** [March 9, 2009, 6:01pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468 "2009-03-09T18:01:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinay-Mittal](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vinay-Mittal](https://techcommunity.softwareag.com/u/Vinay-Mittal)\
**Post date:** [March 9, 2009, 6:01pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/1 "2009-03-09T18:01:08Z")

</div>

Hi  
How can you use entireX SDK to write an application on Linux which could fetch Wbem classes from windows machine?

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [March 9, 2009, 10:55pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/2 "2009-03-09T22:55:00Z")

</div>

You would need to use the Java or .Net RPC Server on the Windows machine. That server’s methods would fetch the information you need from that Windows machine.

You would use any EntireX Wrapper - Java or XML, for example, to make the client call from the Linux application.

---

<div class="post-metadata">

**Author:** ![Vinay-Mittal](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vinay-Mittal](https://techcommunity.softwareag.com/u/Vinay-Mittal)\
**Post date:** [March 10, 2009, 9:52am UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/3 "2009-03-10T09:52:19Z")

</div>

Hi Douglas  
Thanks for the response.  
Is it not possible to query windows machine for Wbem classes without having to install any server there. We already have WMI server running on the windows box which can return the classes.

---

<div class="post-metadata">

**Author:** ![Rolf\_Bahlke](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rolf_bahlke/32/109_2.png) [@Rolf\_Bahlke](https://techcommunity.softwareag.com/u/Rolf_Bahlke)\
**Post date:** [March 10, 2009, 4:52pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/4 "2009-03-10T16:52:58Z")

</div>

I think there is a remote management capability using SOAP.

---

<div class="post-metadata">

**Author:** ![Vinay-Mittal](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vinay-Mittal](https://techcommunity.softwareag.com/u/Vinay-Mittal)\
**Post date:** [March 10, 2009, 5:52pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/5 "2009-03-10T17:52:34Z")

</div>

Any idea on how do we do it using SOAP ?

---

<div class="post-metadata">

**Author:** ![Rolf\_Bahlke](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rolf_bahlke/32/109_2.png) [@Rolf\_Bahlke](https://techcommunity.softwareag.com/u/Rolf_Bahlke)\
**Post date:** [March 10, 2009, 9:53pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/6 "2009-03-10T21:53:00Z")

</div>

You will find a bunch of information on [http://msdn.microsoft.com](http://msdn.microsoft.com)

---

<div class="post-metadata">

**Author:** ![Vinay-Mittal](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vinay-Mittal](https://techcommunity.softwareag.com/u/Vinay-Mittal)\
**Post date:** [March 11, 2009, 5:31pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/7 "2009-03-11T17:31:37Z")

</div>

Hi  
i’ve wriiten a sample client application which simply tries to connect to remote windows machine. But the CoCreateInstanceEx function is returning an error (80040154). Can you tell me what might be going wrong?

---

<div class="post-metadata">

**Author:** ![Vinay-Mittal](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vinay-Mittal](https://techcommunity.softwareag.com/u/Vinay-Mittal)\
**Post date:** [March 11, 2009, 5:44pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/8 "2009-03-11T17:44:59Z")

</div>

here is the snippet of the code

MULTI\_QI mq;  
COSERVERINFO csi, _pcsi=NULL;  
CHAR_ sz = “10.10.1.1”;  
CHAR nm[100];  
WCHAR pwszHostName [MAX\_PATH];  
memset(&csi, 0, sizeof(COSERVERINFO));  
pcsi = &csi;  
HRESULT hr = CoInitializeEx(0, COINIT\_MULTITHREADED);  
hr = CoInitializeSecurity(  
NULL,  
-1, // COM authentication  
NULL, // Authentication services  
NULL, // Reserved  
RPC\_C\_AUTHN\_LEVEL\_CONNECT, // Default authentication  
RPC\_C\_IMP\_LEVEL\_IMPERSONATE, // Default Impersonation  
NULL, // Authentication info  
0, // Additional capabilities  
NULL // Reserved  
);

mq.pIID = &IID\_IWbemLocator;  
mq.pItf = NULL;  
mq.hr = S\_OK;  
csi.pwszName = 0;

hr = CoCreateInstanceEx(CLSID\_WbemLocator, NULL, CLSCTX\_REMOTE\_SERVER, pcsi, 1, &mq);

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [March 11, 2009, 7:49pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/9 "2009-03-11T19:49:47Z")

</div>

you might try a Microsoft or Linux forum for information on DCOM generally. This forum is focused on the DCOM sub-component of the EntireX package and does not really address general DCOM questions.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:51pm UTC](https://techcommunity.softwareag.com/t/query-windows-machien-to-fetch-wbem-classes/80468/10 "2021-04-02T14:51:39Z")

</div>


