Share via


MSFT_Computer.Type Property

Gets the type of the computer.

 sint32 MSFT_Computer.Type

Access

Read-only

Return Value

Signed 32-bit integer

Remarks

The following type values are used.

Value Description
0 Unknown
1 Windows NT Workstation
8 Primary domain controller
16 Backup domain controller
8192 Non-Windows computer groups
32768 Windows NT member servers
32793 All Windows computers

Examples

The following example shows the use of the Type property.

'*********************************************************************
' Routine: Function RemoveNonWindowsComputer
' Purpose: Removes a computer added through WMI.
' Arguments: The server running MOM, GUID of the computer.
' Returns: True, if successful.
'
'*********************************************************************
Const TYPE_NONWINDOWS = 8192

Function RemoveNonWindowsComputer(strMOMServer, strGUID)
    Dim objComputer, objWbemService
    Dim blnSuccess

    blnSuccess = False

    Set objWbemService = GetObject("WinMgmts://" & strMOMServer & "\root\MOM")
    Set objComputer = GetObject("WinMgmts://" & strMOMServer & "\root\MOM:MSFT_Computer=""" & strGUID & """")

    If (Not(objComputer Is Nothing) And (objComputer.Type = TYPE_NONWINDOWS)) Then
        Call objWbemService.Delete(objComputer.Path_)
        blnSuccess = True
    End If

    Set objComputer = Nothing
    Set objWbemService = Nothing

    RemoveNonWindowsComputer = blnSuccess
End Function
  

Requirements

Platforms: Requires Windows 2000 Server or later

Version: Requires MOM 2000 SP1 or later

See Also

MSFT_Computer Class | MSFT_ComputerGroup.Type Property