Skip to content

Instantly share code, notes, and snippets.

@jdkarpin
jdkarpin / VUM proxy reconfiguration.ps1
Created January 3, 2019 14:10
Code example to reconfigure VUM proxy
#Requires -Modules VMware.VimAutomation.Core
#Requires -Modules VMware.VumAutomation
function InitializeVUMService ([VMware.VimAutomation.ViCore.Types.V1.VIServer] $vSphereServer) {
$serviceInstance = Get-View ServiceInstance -Server $vSphereServer
$extensionMgr = Get-View $serviceInstance.Content.ExtensionManager -Server $vSphereServer
$vumExtension = $extensionMgr.FindExtension("com.vmware.vcIntegrity")
if ($vumExtension -eq $null) {
throw New-Object System.Exception -ArgumentList "Update Manager extension is not found for vSphere Server '$($server.Name)'"
}