Share via


Enable-SCOMDiscovery

Enables Operations Manager discoveries.

Syntax

Empty (Default)

Enable-SCOMDiscovery
    [-Discovery] <ManagementPackDiscovery[]>
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromGroup

Enable-SCOMDiscovery
    [-Discovery] <ManagementPackDiscovery[]>
    [[-Group] <MonitoringObject[]>]
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromInstance

Enable-SCOMDiscovery
    [-Discovery] <ManagementPackDiscovery[]>
    [[-Instance] <MonitoringObject[]>]
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

FromManagementPackClass

Enable-SCOMDiscovery
    [-Discovery] <ManagementPackDiscovery[]>
    [-Class] <ManagementPackClass[]>
    [-ManagementPack] <ManagementPack>
    [-Enforce]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Enable-SCOMDiscovery cmdlet enables System Center - Operations Manager discoveries. The cmdlet creates and saves overrides for specified discoveries that enable those discoveries.

Examples

Example 1: Enable 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:\> Enable-SCOMDiscovery -Class $Class -ManagementPack $MP -Discovery $Discovery -Enforce

This example enables discoveries for a specified class. The Enable-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 enables the discoveries. The $Discovery variable contains objects that represented discoveries. 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 enables discoveries for these classes.

Parameter properties

Type:

ManagementPackClass[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPackClass
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Discovery

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

Parameter properties

Type:

ManagementPackDiscovery[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enforce

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Group

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

Parameter properties

Type:

MonitoringObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromGroup
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Instance

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

This parameter also accepts group objects. To obtain a group object, use the Get-SCOMGroup cmdlet.

Parameter properties

Type:

MonitoringObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromInstance
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ManagementPack

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

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

Parameter properties

Type:ManagementPack
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.