Enumerator.AtEndOfStream property

Gets a Boolean value that indicates whether there are any more items in the collection.

This property is read-only.

Syntax

Enumerator.AtEndOfStream As BOOLEAN

Property value

True

No more items are in the collection.

False

More items are available.

Remarks

If you free the Enumerator object after you have obtained all the data required, then any pending enumeration requests are removed. For more information, see Enumerating or Listing All of the Instances of a Resource.

Examples

The following VBScript example enumerates operating system instances. Note that the freeing of the enumeration object cleans up any pending enumeration requests. The DisplayOutput subroutine formats the data output in the same way as the WinRM.cmd tool.

Const RemoteComputer = "servername.domain.com"

Set objWsman = CreateObject( "WSMan.Automation" )
Set objSession = objWsman.CreateSession( "https://" & _
    RemoteComputer )

strResource = "http://schemas.microsoft.com/wbem/wsman/1/" &_
    "wmi/root/cimv2/Win32_OperatingSystem"

Set objResultSet = objSession.Enumerate( strResource )

While Not objResultSet.AtEndOfStream
 
 DisplayOutput( objResultSet.ReadItem ) 

Wend

'****************************************************
' Displays WinRM XML message using built-in XSL
'****************************************************
Sub DisplayOutput( strWinRMXml )
 Dim xmlFile, xslFile
 Set xmlFile = CreateObject( "MSXml2.DOMDocument.3.0" ) 
 Set xslFile = CreateObject( "MSXml2.DOMDocument.3.0" )
 xmlFile.LoadXml( strWinRMXml )
 xslFile.Load( "WsmTxt.xsl" )
 Wscript.Echo xmlFile.TransformNode( xslFile ) 
End Sub

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
WSManDisp.h
IDL
WSManDisp.idl
Library
WSManDisp.tlb
DLL
WSMAuto.dll

See also

Enumerator

Enumerating or Listing All of the Instances of a Resource