Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 225804

Re: Script to export/import Alarms between VC or synchronize alarms between 2 Virtual Centers

$
0
0

Hi Angel,

 

I am able to get all the alarms info by decalaring $xml=@().

function ExportAlarm(){

Connect-VIServer $serverToExportFrom -User 'xxx'-Password 'xxx'

#$alarmToExport = Get-AlarmDefinition $alarmToExportName

    $alarmToExport = Get-AlarmDefinition -Entity (Get-Folder -NoRecursion)

    $xml= @()

    foreach ($alarm in $alarmToExport)

    {

    $a = Get-View -Id $alarm.Id

    $xml += $a.Info

    }

    $xml | Export-Clixml -Path $fileName -Depth ( [System.Int32]::MaxValue )

}

 

Thanks to RS_1.

 

 


Viewing all articles
Browse latest Browse all 225804

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>