4.7.6 Enumerate Remote Shells

This examples shows how to list the open Shells by using the enum:Enumerate message. Each pull request is limited to five Shell instances, but because only one remote Shell is active at the time of the request, only one instance is returned.

Enumerate Request

 <s:Envelope 
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:To>http://SORINOTEST05:80/wsman</wsa:To>
     <wsman:ResourceURI s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd
     </wsman:ResourceURI>
     <wsa:ReplyTo>
       <wsa:Address s:mustUnderstand="true">
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </wsa:Address>
     </wsa:ReplyTo>
     <wsa:Action s:mustUnderstand="true">
       http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate
     </wsa:Action>
     <wsman:MaxEnvelopeSize s:mustUnderstand="true">153600</wsman:MaxEnvelopeSize>
     <wsa:MessageID>uuid:08E59736-6A1B-4560-8442-64E4D7A26EB5</wsa:MessageID>
     <wsman:Locale xml:lang="en-US" s:mustUnderstand="false" />
     <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout>
   </s:Header>
   <s:Body>
     <wsen:Enumerate>
     </wsen:Enumerate>
   </s:Body>
 </s:Envelope>

Enumerate Response

  
 <s:Envelope
   xml:lang="en-US"
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:Action  >
       http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse
     </wsa:Action>
     <wsa:MessageID  >
       uuid:337E353D-C3EA-4021-B4BE-6BC20AEEB490
     </wsa:MessageID>
     <wsa:To>
       http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
     </wsa:To>
     <wsa:RelatesTo>
       uuid:08E59736-6A1B-4560-8442-64E4D7A26EB5</wsa:RelatesTo>
   </s:Header>
   <s:Body>
     <wsen:EnumerateResponse>
       <wsen:EnumerationContext>
         uuid:F2EF0F83-D6E5-4F70-8E6B-D870551A5D9A
       </wsen:EnumerationContext>
     </wsen:EnumerateResponse>
   </s:Body>
 </s:Envelope>
  

Pull Request

  
 <s:Envelope
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:To>http://SORINOTEST05:80/wsman</wsa:To>
     <wsman:ResourceURI s:mustUnderstand="true">
       http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd
     </wsman:ResourceURI>
     <wsa:ReplyTo>
       <wsa:Address s:mustUnderstand="true">
         http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </wsa:Address>
     </wsa:ReplyTo>
     <wsa:Action s:mustUnderstand="true">
       http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
     </wsa:Action>
     <wsman:MaxEnvelopeSize s:mustUnderstand="true">153600</wsman:MaxEnvelopeSize>
     <wsa:MessageID>
       uuid:BE9EDB22-23A3-489A-B025-ED7F3461E4AB</wsa:MessageID>
     <wsman:Locale xml:lang="en-US" s:mustUnderstand="false" />
     <wsman:OperationTimeout>PT60.000S</wsman:OperationTimeout>
   </s:Header>
   <s:Body>
     <wsen:Pull>
       <wsen:EnumerationContext
         xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration">
         uuid:F2EF0F83-D6E5-4F70-8E6B-D870551A5D9A
         </wsen:EnumerationContext>
       <wsen:MaxElements>5</wsen:MaxElements>
     </wsen:Pull>
   </s:Body>
 </s:Envelope>
  

Pull Response

  
 <s:Envelope
   xml:lang="en-US"
   xmlns:s="http://www.w3.org/2003/05/soap-envelope"
   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
   xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
   xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:Action  >
       http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse
     </wsa:Action>
     <wsa:MessageID  >
       uuid:EAB18F1F-0D6F-4176-989B-741ADD72A933
     </wsa:MessageID>
     <wsa:To>
       http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
     </wsa:To>
     <wsa:RelatesTo>uuid:BE9EDB22-23A3-489A-B025-ED7F3461E4AB</wsa:RelatesTo>
   </s:Header>
   <s:Body>
     <wsen:PullResponse>
       <wsen:Items>
         <rsp:Shell
        xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell">
           <rsp:ShellId>
             uuid:5B666291-0910-4E8F-B802-B697ACD7953D
           </rsp:ShellId>
           <rsp:Lifetime>PT28737.000S</rsp:Lifetime>
           <rsp:InputStreams>stdin</rsp:InputStreams>
           <rsp:OutputStreams>stdout stderr</rsp:OutputStreams>
           <rsp:CommandLine>
             <rsp:Command>pause</rsp:Command>
           </rsp:CommandLine>
         </rsp:Shell>
       </wsen:Items>
       <wsen:EndOfSequence/>
       </wsen:PullResponse>
   </s:Body>
 </s:Envelope>