Set-SCPROMonitorConfiguration
Set-SCPROMonitorConfiguration
Updates the properties of a PRO monitor configuration.
構文
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>]
詳細説明
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.
パラメーター
-AutomaticMode<Boolean>
Indicates whether dynamic optimization automatically migrates virtual machines in order to load balance.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Inherit
Indicates that settings are inherited from the parent host group.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-MonitoringEnabled<Boolean>
Indicates whether monitoring is enabled for a PRO monitor.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PROMonitorConfiguration<PROMonitorConfiguration>
Specifies a PRO monitor configuration object.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-PROTipID<Guid]>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VMMServer<ServerConnection>
Specifies a VMM server object.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- PROMonitorConfiguration
例
Example 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 then stores the object in the $PROMonitor variable.
The second command gets the host object named VMHost01, and then 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 then 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
Example 2: Disable automatic remediation for all PRO monitors on a specified host
The first command gets the host object named VMHost01, and then stores the object in the $VMHost variable.
The second command gets all PRO monitor configuration objects on VMHost01, and then 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 then disables automatic remediation for each monitor configuration. For more information about the Windows PowerShell Foreach statement, type Get-Help about_Foreach
.
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}