Windows Dev Center

IWSManSession::Enumerate method

Enumerates a table, data collection, or log resource. To create a query, include a filter parameter and a dialect parameter in an enumeration. You can also use an IWSManResourceLocator object to create queries. For more information, see Enumerating or Listing All the Instances of a Resource.

Syntax


HRESULT  Enumerate(
  [in]           Variant   resourceUri,
  [in, optional] BSTR      filter,
  [in, optional] BSTR      dialect,
  [in]           long      flags,
  [out]          IDispatch **resultSet
);

Parameters

resourceUri [in]

The identifier of the resource to be retrieved.

The following list contains identifiers that this parameter can contain:

filter [in, optional]

A filter that defines what items in the resource are returned by the enumeration. When the resource is enumerated, only those items that match the filter criteria are returned. Including a filter parameter and a dialect parameter in an enumeration converts the enumeration into a query.

If you have an IWSManResourceLocator object for the resourceURI parameter, then this parameter should not be used. Instead, use the selector and fragment functionality of IWSManResourceLocator.

dialect [in, optional]

The language used by the filter. WQL, a subset of SQL used by WMI, is the only language supported.

If you have a IWSManResourceLocator object for the resourceURI parameter, then this parameter should not be used. Instead, use the selector and fragment functionality of IWSManResourceLocator.

flags [in]

This parameter must contain a flag in the __WSManEnumFlags enumeration. For more information, see Enumeration Constants.

resultSet [out]

An IWSManEnumerator object that contains the results of the enumeration.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Call IWSManSession::Enumerate to start an enumeration operation. Thereafter, call IWSManEnumerator::ReadItem using the returned IWSManEnumerator object until the end of items is indicated by the AtEndOfStream property.

Be aware that if the flags include the Enumeration Constants WSManFlagHierarchyDeepBasePropsOnly or WSManFlagHierarchyShallow then Windows Remote Management service returns the error code ERROR_WSMAN_POLYMORPHISM_MODE_UNSUPPORTED.

For more information about limiting network calls during an enumeration, see the BatchItems property.

If a filter is specified, it must be a valid document with respect to the schema of the resource. The dialect parameter is optional. However, if the filter string begins with <, but is not an XML fragment, then either include the dialect parameter or set the WSManFlagNonXmlText flag in the flags parameter. For more information, see Enumeration Constants.

The corresponding scripting method is Session.Enumerate.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Redistributable

WinRM 1.1 (Windows Server 2003 R2, or Windows Server 2003 with SP1)

Header

Wsmandisp.h

IDL

Wsmandisp.idl

Library

WSManAutomation.lib

DLL

Wsmauto.dll

See also

IWSManSession
IWSManEnumerator
Session.Enumerate

 

 

Show:
© 2015 Microsoft