Microsoft Identity Integration Server 2003 Developer Reference

NumMVObjects Method of the MIIS_Server Class

The NumMVObjects method returns the number of all objects in the metaverse. To use this method, you must be logged on as a member of the MIISOperators or the MIISAdmins security group.
string NumMVObjects();

Parameters

This method has no parameters.

Return Values

Returns the number of all objects in the metaverse or the following return values:
Return code Description
call-failure An unexpected error occurred. Check the event log.
connection-failure The server is not running or your credentials were removed from the security groups. Check that the credentials that you used belong to a member of a Microsoft Identity Integration Server 2003 security group. The method can return this string after you get the WMI provider object.

Example Code

The following example shows you how to use the Visual Basic Scripting Edition (VBScript) to get the number of objects in the metaverse using the ExecQuery method:

Option Explicity

On Error Resume Next

Dim Service
Dim Servers

Set Service = GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set Servers = Service.ExecQuery("Select * from MIIS_Server1")
For Each Server in Servers
   WScript.Echo "Count of Metaverse Objects = " & Server.NumMvObjects()
Next

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

The following example uses the Get method to get the number of objects in the metaverse:

Option Explicit

On Error Resume Next

Dim Service
Dim Server

Set Service = GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set Server = Service.Get("MIIS_Server.Name='MIIS_Server1'")
WScript.Echo "Count of Metaverse Objects = " & Server.NumMvObjects()

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

Requirements

Server: Requires Microsoft Identity Integration Server 2003.
Header: Declared in mmswmi.mof.


See Also

MIIS_Server