Partager via


NumMVObjects Method

Returns the number of all objects that are in the metaverse. To use this method, you must be logged on as a member of the MIISOperators security group or the MIISAdmins security group.

mof
string NumMVObjects();

Parameters

None

Name : NumMVObjects

Return Value

string

Returns the number of all objects that are in the metaverse, or the following return values.

Name 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. Verify that the credentials that you used belong to a member of a Forefront Identity Manager Synchronization Service (FIM Synchronization Service) security group. The method can return this string after you get the Windows Management Instrumentation (WMI) provider object.

Example

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

Option Explicit

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

Product

Forefront Identity Manager Synchronization Service 2010

MOF

Mmswmi.mof

See Also

Reference

MIIS_Server Class

Concepts

Methods
WMI Provider Reference