Set-SCPROMonitorConfiguration
Updates the properties of a PRO monitor configuration.
Syntax
EditSetting
Set-SCPROMonitorConfiguration
-PROMonitorConfiguration <PROMonitorConfiguration>
-AutomaticMode <Boolean>
-MonitoringEnabled <Boolean>
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Inherit
Set-SCPROMonitorConfiguration
-PROMonitorConfiguration <PROMonitorConfiguration>
[-VMMServer <ServerConnection>]
[-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.
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
EditSetting
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Inherit
Indicates that settings are inherited from the parent host group.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Inherit
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-MonitoringEnabled
Indicates whether monitoring is enabled for a PRO monitor.
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
EditSetting
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PROMonitorConfiguration
Specifies a PRO monitor configuration object.
Parameter properties
Type: | PROMonitorConfiguration |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | Guid |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a Virtual Machine Manager (VMM) server object.
Parameter properties
Type: | ServerConnection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
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.
Outputs
PROMonitorConfiguration
This cmdlet returns a PROMonitorConfiguration object.