WinRM request failure

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

WinRM request failure

Con O'Donnell
 

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: WinRM request failure

Klaus Kaempf
* Con O'Donnell <[hidden email]> [Jan 07. 2016 21:24]:

>  
>
> 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";
>
[...]
>  
>
> 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

You must use a wildcard URI instead of a class-specific one. The class
is specified in the query, not in the URL.

Use http://schemas.dmtf.org/wbem/wscim/1/* for the URI instead.

Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

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