PowerCLI Reference

Set-AlarmDefinition

Synopsis

This cmdlet modifies the specified alarm definitions.

Syntax

Set-AlarmDefinition [-AlarmDefinition] <AlarmDefinition[]> [-ActionRepeatMinutes <Int32>] [-Description <String>] [-Enabled <Boolean>] [-Name <String>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-AlarmDefinition
Get-AlarmAction
Get-AlarmActionTrigger
New-AlarmAction
New-AlarmActionTrigger
Remove-AlarmAction
Remove-AlarmActionTrigger

Detailed Description

This cmdlet modifies the specified alarm definitions.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
AlarmDefinitionAlarmDefinition[]Specifies the alarm definition you want to modify.truetrue (ByValue)
ActionRepeatMinutesInt32Specifies a time period in minutes to define how often the alarm action repeats if the alarm is active.falsefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
DescriptionStringSpecifies a new description for the alarm definition.falsefalse
EnabledBooleanIndicates that the alarm definition is enabled.falsefalse
NameStringSpecifies a new name for the alarm definition.falsefalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

Zero or more modified AlarmDefinition objects

Notes

Examples

-------------- Example 1 --------------

Get-AlarmDefinition -Name 'alarms' | Set-AlarmDefinition -ActionRepeatMinutes ($_.ActionRepeatMinutes + 1)

Increase all selected alarms action repeat minutes.

-------------- Example 2 --------------

Get-AlarmDefinition -Name 'alarm' | foreach {$_ | Set-AlarmDefinition -Name 'alarm new name' -Description 'new description' -Enabled:$true}

Changes the name, description, and the Enabled flag of the selected alarms.


Copyright © VMware, Inc. All rights reserved.