MSFT_ComputerGroup.IsEnabled Property
Gets or sets whether the computer group is enabled.
boolean MSFT_ComputerGroup.IsEnabled
Access
Read/write
Return Value
Boolean
Examples
The following example shows the use of the IsEnabled property.
'*********************************************************************
' Routine: Function ResetAllNonWindowsComputerGroups
' Purpose: Enable or disables all non-Windows computer groups.
' Arguments: The server running MOM, boolean to specify whether the groups
' should be enabled or disabled.
' Returns: The number of computer groups changed.
'
'**********************************************************************
Const TYPE_NONWINDOWS = 8192
Function ResetAllNonWindowsComputerGroups(strMOMServer, blnEnable)
Dim objComputerGroups, objComputerGroup
Dim lngChanged
lngChanged = 0
blnEnable = CBool(blnEnable)
Set objComputerGroups = GetObject("WinMgmts://" & strMOMServer & "\root\MOM").ExecQuery("SELECT * FROM MSFT_ComputerGroup")
For Each objComputerGroup In objComputerGroups
If (objComputerGroup.Type = TYPE_NONWINDOWS) Then
If (objComputerGroup.IsEnabled <> blnEnable) Then
objComputerGroup.IsEnabled = blnEnable
Call objComputerGroup.Put_()
lngChanged = lngChanged + 1
End If
End If
Next
Set objComputerGroups = Nothing
Set objComputerGroup = Nothing
ResetAllNonWindowsComputerGroups = lngChanged
End Function
Requirements
Platforms: Requires Windows 2000 Server or later
Version: Requires MOM 2000 SP1 or later