Cannot send filtered request to WinRM

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot send filtered request to WinRM

O'Donnell, Con

Hi All,

 

Trying to send a simple WQL filter to my test Domain Controller…

 

 

#define WS_WINDOWS_ACCOUNT_URI       "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account"

 

 

       std::string sidQuery = "select * from Win32_Account";

       filter_t *wsmc_filter = filter_create_simple(WSM_WQL_FILTER_DIALECT, sidQuery.c_str());

       WsXmlDocH doc = wsmc_action_enumerate(_wsmc_client, WS_WINDOWS_ACCOUNT_URI, wsmc_options, wsmc_filter);

 

Pcap shows what is being sent is:

 

<?xml version="1.0" encoding="UTF-8"?>

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><s:Header><wsa:Action s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</wsa:Action><wsa:To s:mustUnderstand="true">http://2K8R2-DC1.TESTLAB.LOCAL:5985/wsman</wsa:To><wsman:ResourceURI s:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account</wsman:ResourceURI><wsa:MessageID s:mustUnderstand="true">uuid:462da87d-3d06-47b6-a2ef-373c35ee2db8</wsa:MessageID><wsman:OperationTimeout>PT60.0S</wsman:OperationTimeout><wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo></s:Header><s:Body>

<wsen:Enumerate><wsman:Filter Dialect="http://schemas.microsoft.com/wbem/wsman/1/WQL">select * from Win32_Account</wsman:Filter></wsen:Enumerate></s:Body></s:Envelope>

 

WinRM (Windows 2008 R2) returns:

 

Action failed reason :The WinRM client cannot process the request. The resource URI for an enumeration operation with WQL filter must not contain keys and the class name must be '*' (star). Use the following command to get more information

in how to construct a resource URI: "winrm help uris".

 

I cannot find a reason for the error, any ideas ?

 

All the Best

 

Con O’Donnell

 

 


------------------------------------------------------------------------------

_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cannot send filtered request to WinRM

O'Donnell, Con

Please ignore this,I found my ResourceURI should have been:

 

http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*

 

All the Best

 

 

From: O'Donnell, Con
Sent: Thursday, January 07, 2016 12:20 PM
To: '[hidden email]'
Subject: Cannot send filtered request to WinRM

 

Hi All,

 

Trying to send a simple WQL filter to my test Domain Controller…

 

 

#define WS_WINDOWS_ACCOUNT_URI       "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account"

 

 

       std::string sidQuery = "select * from Win32_Account";

       filter_t *wsmc_filter = filter_create_simple(WSM_WQL_FILTER_DIALECT, sidQuery.c_str());

       WsXmlDocH doc = wsmc_action_enumerate(_wsmc_client, WS_WINDOWS_ACCOUNT_URI, wsmc_options, wsmc_filter);

 

Pcap shows what is being sent is:

 

<?xml version="1.0" encoding="UTF-8"?>

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><s:Header><wsa:Action s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</wsa:Action><wsa:To s:mustUnderstand="true">http://2K8R2-DC1.TESTLAB.LOCAL:5985/wsman</wsa:To><wsman:ResourceURI s:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account</wsman:ResourceURI><wsa:MessageID s:mustUnderstand="true">uuid:462da87d-3d06-47b6-a2ef-373c35ee2db8</wsa:MessageID><wsman:OperationTimeout>PT60.0S</wsman:OperationTimeout><wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo></s:Header><s:Body>

<wsen:Enumerate><wsman:Filter Dialect="http://schemas.microsoft.com/wbem/wsman/1/WQL">select * from Win32_Account</wsman:Filter></wsen:Enumerate></s:Body></s:Envelope>

 

WinRM (Windows 2008 R2) returns:

 

Action failed reason :The WinRM client cannot process the request. The resource URI for an enumeration operation with WQL filter must not contain keys and the class name must be '*' (star). Use the following command to get more information

in how to construct a resource URI: "winrm help uris".

 

I cannot find a reason for the error, any ideas ?

 

All the Best

 

Con O’Donnell

 

 


------------------------------------------------------------------------------

_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cannot send filtered request to WinRM

Con O'Donnell
In reply to this post by O'Donnell, Con

Please ignore this,I found my ResourceURI should have been:


 


http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*


 


All the Best


 

From: [hidden email]
To: [hidden email]
Date: Thu, 7 Jan 2016 20:20:18 +0000
Subject: [Openwsman-devel] Cannot send filtered request to WinRM

Hi All,

 

Trying to send a simple WQL filter to my test Domain Controller…

 

 

#define WS_WINDOWS_ACCOUNT_URI       "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account"

 

 

       std::string sidQuery = "select * from Win32_Account";

       filter_t *wsmc_filter = filter_create_simple(WSM_WQL_FILTER_DIALECT, sidQuery.c_str());

       WsXmlDocH doc = wsmc_action_enumerate(_wsmc_client, WS_WINDOWS_ACCOUNT_URI, wsmc_options, wsmc_filter);

 

Pcap shows what is being sent is:

 

<?xml version="1.0" encoding="UTF-8"?>

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><s:Header><wsa:Action s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</wsa:Action><wsa:To s:mustUnderstand="true">http://2K8R2-DC1.TESTLAB.LOCAL:5985/wsman</wsa:To><wsman:ResourceURI s:mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Account</wsman:ResourceURI><wsa:MessageID s:mustUnderstand="true">uuid:462da87d-3d06-47b6-a2ef-373c35ee2db8</wsa:MessageID><wsman:OperationTimeout>PT60.0S</wsman:OperationTimeout><wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo></s:Header><s:Body>

<wsen:Enumerate><wsman:Filter Dialect="http://schemas.microsoft.com/wbem/wsman/1/WQL">select * from Win32_Account</wsman:Filter></wsen:Enumerate></s:Body></s:Envelope>

 

WinRM (Windows 2008 R2) returns:

 

Action failed reason :The WinRM client cannot process the request. The resource URI for an enumeration operation with WQL filter must not contain keys and the class name must be '*' (star). Use the following command to get more information

in how to construct a resource URI: "winrm help uris".

 

I cannot find a reason for the error, any ideas ?

 

All the Best

 

Con O’Donnell

 

 


------------------------------------------------------------------------------
_______________________________________________ Openwsman-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openwsman-devel

------------------------------------------------------------------------------

_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel