Set-SCPROMonitorConfiguration

Set-SCPROMonitorConfiguration

Updates the properties of a PRO monitor configuration.

Syntax

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

Parameter Set: Inherit
Set-SCPROMonitorConfiguration -Inherit -PROMonitorConfiguration <PROMonitorConfiguration> [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed 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.

Parameters

-AutomaticMode<Boolean>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Inherit

Indicates whether settings are inherited from the parent host group.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MonitoringEnabled<Boolean>

Indicates that monitoring is enabled for a PRO monitor.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROMonitorConfiguration<PROMonitorConfiguration>

Specifies a PRO monitor configuration object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-PROTipID<Guid>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • PROMonitorConfiguration

Examples

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

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 $PROMinotir 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.

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

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

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.

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}

Get-SCPROMonitor

Get-SCPROMonitorConfiguration