Quantcast
Viewing all articles
Browse latest Browse all 293210

Re: Modify Database Retention Policy with PowerCLI

I see, in that case we will have to fall back on the underlying SDK method.

Try it like this (you need to be connected to the vCenter)

 

$si = Get-View ServiceInstance 
$optMgr
= Get-View $si.Content.Setting $spec = @() $event1 = New-Object VMware.Vim.OptionValue
$event1
.key = "event.maxAge"  $event1.value = 120
$spec
+= $event1
$event2
= New-Object VMware.Vim.OptionValue
$event2.key = "event.maxAgeEnabled"  $event2.value = $true
$spec
+= $event2
$task1
= New-Object VMware.Vim.OptionValue
$task1
.key = "task.maxAge"  $task1.value = 120
$spec += $task1
$task2
= New-Object VMware.Vim.OptionValue
$task2
.key = "task.maxAgeEnabled"  $task2.value = $true
$spec
+= $task2
$optMgr.UpdateOptions($spec)

Viewing all articles
Browse latest Browse all 293210

Trending Articles