Microsoft Identity Integration Server 2003 Developer Reference

Example: Getting the Number of Metaverse Objects in the Server

You can use the MIIS_Server.NumMVObjects property to get the number of objects in the metaverse.

The following Visual Basic Scripting Edition (VBScript) example shows how to get the number of objects in the metaverse.

Option Explicit

On Error Resume Next

Const PktPrivacy = 6  ' Authentication level

Dim Service		 ' Service object
Dim MVSet			 ' Metaverse collection
Dim Metaverse		 ' Metaverse object

Set Service = GetObject("winmgmts:{authenticationLevel=PktPrivacy}!root\MicrosoftIdentityIntegrationServer")

Set MVSet = Service.ExecQuery("Select * From MIIS_Server")

' Get the number of objects in the metaverse.
For Each Metaverse in MVSet

   WScript.Echo "Server Name: " & Metaverse.Name

   WScript.Echo "Metaverse Objects: " & Metaverse.NumMVObjects

Next

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
  WScript.Quit(1)
End Sub

See Also

MIIS_Server, MIIS_Server.NumMVObjects, Enabling Security in Scripts