Set-SCPROMonitorConfiguration

Updates the properties of a PRO monitor configuration.

Syntax

Set-SCPROMonitorConfiguration
   [-VMMServer <ServerConnection>]
   -PROMonitorConfiguration <PROMonitorConfiguration>
   -AutomaticMode <Boolean>
   -MonitoringEnabled <Boolean>
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCPROMonitorConfiguration
   [-VMMServer <ServerConnection>]
   -PROMonitorConfiguration <PROMonitorConfiguration>
   [-Inherit]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

The Set-SCPROMonitorConfiguration cmdlet updates the properties of one or more Performance and Resource Optimization (PRO) monitor configuration objects. Properties that can be set include whether monitoring and automatic remediation are enabled.

Examples

Example 1: Enable monitoring and automatic remediation for a specific PRO monitor

PS C:\> $PROMonitor = Get-SCPROMonitor -Name "System Center Virtual Machine Manager Maximum Dynamic Memory Monitor" -ManagementPackName "System Center Virtual Machine Manager PRO V2 HyperV Host Performance"
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $PROMonitorConfig = Get-SCPROMonitorConfiguration -PROMonitor $PROMonitor -VMHost $VMHost
PS C:\> Set-SCPROMOnitorConfiguration -PROMonitorConfiguration $PROMonitorConfig -MonitoringEnabled $True -AutomaticMode $True

The first command gets the PRO monitor object with the specified name and management pack name and stores the object in the $PROMonitor variable.

The second command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The third command gets the PRO monitor configuration object for the PRO monitor stored in $PROMonitor on VMHost01 and stores the object in the $PROMonitorConfig variable.

The last command enables monitoring and automatic remediation for the PRO monitor configuration stored in $PROMonitorConfig.

Example 2: Disable automatic remediation for all PRO monitors on a specified host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $PROMonitorConfigs = @(Get-SCPROMonitorConfiguration -VMHost $VMHost)
PS C:\> ForEach ($PROMonitorConfig in $PROMonitorConfigs) {Set-SCPROMonitorConfiguration -PROMonitorConfiguration $PROMonitorConfig -MonitoringEnabled $True -AutomaticMode $False}

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gets all PRO monitor configuration objects on VMHost01 and stores the objects in the $PROMonitorConfigs object array.

The last command uses the ForEach statement to iterate through each PRO monitor configuration object stored in $PROMonitorConfigs and disables automatic remediation for each monitor configuration.

Parameters

-AutomaticMode

Indicates whether dynamic optimization automatically migrates virtual machines in order to load balance.

Type:Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Inherit

Indicates that settings are inherited from the parent host group.

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

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MonitoringEnabled

Indicates whether monitoring is enabled for a PRO monitor.

Type:Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PROMonitorConfiguration

Specifies a PRO monitor configuration object.

Type:PROMonitorConfiguration
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

-VMMServer

Specifies a Virtual Machine Manager (VMM) server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

PROMonitorConfiguration

This cmdlet returns a PROMonitorConfiguration object.