CompassITCanada
Contributor
Contributor

Script Help: Trying to remove Alarm Definitions for vSAN as we won't use it ever

Jump to solution

My scripting is really rusty and I'm trying to remove all vSAN pre defined Alarms as there are 278 of them or some high number.

All the searching I have done doesn't seem relevant or have right syntax for 6.7

Thanks in anticipation

Twister

0 Kudos
2 Solutions

Accepted Solutions
amohammadimir
Enthusiast
Enthusiast

I wrote this PowerCLI script for you, it might be helpful:

Get-AlarmDefinition | Where-Object { $_.Name -like '*vSAN*'} | Set-AlarmDefinition -Enabled:$false

Please remember to mark the replies as answers if they helped.

View solution in original post

0 Kudos
CompassITCanada
Contributor
Contributor

Thanks amirmohammadimir, that got going in right direction. Very much appreciated.Smiley Happy

I amended the action to | Remove-AlarmDefinition so that the Alarms were removed as desired.

Final command works a treat

Get-AlarmDefinition | Where-Object {$_.Name -like '*vSAN*'} | Remove-AlarmDefinition

View solution in original post

0 Kudos
2 Replies
amohammadimir
Enthusiast
Enthusiast

I wrote this PowerCLI script for you, it might be helpful:

Get-AlarmDefinition | Where-Object { $_.Name -like '*vSAN*'} | Set-AlarmDefinition -Enabled:$false

Please remember to mark the replies as answers if they helped.

View solution in original post

0 Kudos
CompassITCanada
Contributor
Contributor

Thanks amirmohammadimir, that got going in right direction. Very much appreciated.Smiley Happy

I amended the action to | Remove-AlarmDefinition so that the Alarms were removed as desired.

Final command works a treat

Get-AlarmDefinition | Where-Object {$_.Name -like '*vSAN*'} | Remove-AlarmDefinition

View solution in original post

0 Kudos