Disable-SCOMDiscovery

Disables Operations Manager discoveries.

Syntax

Disable-SCOMDiscovery
       [-Discovery] <ManagementPackDiscovery[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMDiscovery
       [-Discovery] <ManagementPackDiscovery[]>
       [[-Instance] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMDiscovery
       [-Discovery] <ManagementPackDiscovery[]>
       [[-Group] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMDiscovery
       [-Discovery] <ManagementPackDiscovery[]>
       [-Class] <ManagementPackClass[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Disable-SCOMDiscovery cmdlet disables System Center - Operations Manager discoveries. The cmdlet creates and saves overrides for specified discoveries that disable those discoveries.

Specify groups, instances, or classes, along with the discoveries to disable. The cmdlet saves overrides to a specified unsealed management pack.

Examples

Example 1: Disable discoveries for a class

PS C:\>$MP = Get-SCOMManagementPack -displayname "My SQL MP Customization" | Where-Object {$_.Sealed -eq $False}
PS C:\> $Class = Get-SCOMClass -DisplayName "SQL DB Engine"
PS C:\> $Discovery = Get-SCOMDiscovery -DisplayName *rule*
PS C:\> Disable-SCOMDiscovery -Class $Class -Discovery $Discovery -ManagementPack $MP

This example disables discoveries for a specified class. The Disable-SCOMDiscovery cmdlet saves an override in a specified management pack.

The first command uses the Get-SCOMManagementPack cmdlet to get management pack objects that have the specified display name, and passes them to the Where-Object cmdlet by using the pipeline operator. That cmdlet drops any sealed management packs. For more information, type Get-Help Where-Object. The command stores all unsealed management packs in the $MP variable.

The second command uses the Get-SCOMClass cmdlet to get classes that have the specified display name, and then stores them in the $Class variable.

The third command uses the Get-SCOMDiscovery cmdlet to get discovery objects that have display names that contain the string rule, and then stores them in the $Discovery variable.

The fourth command disables the discoveries represented by the objects stored in the $Discovery variable. The command specifies the class object stored in the $Class variable. The cmdlet saves the override in the management pack represented by the object in the $MP variable. The command uses the Enforce parameter; therefore the cmdlet sets the Enforce property to $True.

Parameters

-Class

Specifies an array of management pack class objects. To obtain a class object, use the Get-SCOMClass cmdlet. The cmdlet disables discoveries for these classes.

Type:ManagementPackClass[]
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Discovery

Specifies an array of ManagementPackDiscovery objects. To obtain a ManagementPackDiscovery object, use the Get-SCOMDiscovery cmdlet.

Type:ManagementPackDiscovery[]
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Enforce

Indicates that the cmdlet sets the Enforce property to $True on the override.

Type:SwitchParameter
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Group

Specifies an array of monitoring objects that represent groups. To obtain a group, use the Get-SCOMGroup cmdlet. The cmdlet disables discoveries for these groups.

Type:MonitoringObject[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Instance

Specifies an array of monitoring objects that represent instances. To obtain instances, use the Get-SCOMClassInstance cmdlet. The cmdlet disables discoveries for these instances.

Type:MonitoringObject[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ManagementPack

Specifies one or more management pack objects. To obtain a management pack object, use the Get-SCOMManagementPack cmdlet. The cmdlet saves overrides into the specified management pack.

If the discovery is in an unsealed management pack, you must save the override into the same management pack.

Type:ManagementPack
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Indicates that the cmdlet creates or modifies an object that a command can use in the pipeline. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False