Share via


MSFT_Computer.ScanAllManagedComputers Method

Initiates an immediate scan of all computers belonging to the Agent Manager on the server where this WMI object is stored.

 MSFT_Computer.ScanAllManagedComputers()

Parameters

None

Return Value

This method returns a uint32 indicating its status.

Remarks

Note Note   

This method is deprecated in MOM 2005 and should not be used. MOM 2005 does not use an Agent Manager component. In MOM 2005, calls to this method do not return an error code, but the method has no effect on agents.

All the computers managed by the server running MOM, to which you are connected, will be scanned. If the task of managing MOM agents on your network is distributed across multiple servers running MOM, you must call this method on each server.

ScanAllManagedComputers is a static method. It is called from the MSFT_Computer class definition, rather than particular instances of the MSFT_Computer class.

Examples

The following example shows the use of the ScanAllManagedComputers method.

'*********************************************************************
' Routine: Function ScanAllOnServer
' Purpose: Requests a scan of all computers managed by the specified
'          the server running MOM.
' Arguments: The server running MOM.
' Returns: The scan status.
'
'**********************************************************************
Function ScanAllOnServer(strMOMServer)
    Dim objComputerClass
    Dim lngStatus

    lngCount = 0

    ' get the MSFT_Computer class
    Set objComputerClass = GetObject("WinMgmts://" & strMOMServer & "\root\MOM:MSFT_Computer")

    ' call the static method
    lngStatus = objComputerClass.ScanAllManagedComputers()

    Set objComputerClass = Nothing

    ScanAllOnServer = lngStatus
End Function
  

Requirements

Platforms: Requires Windows 2000 Server or later

Version: Requires MOM 2000 SP1 or later

See Also

MSFT_Computer Class | MSFT_Computer.ScanManagedComputer Method