I’ve got a powerfull snippet of code for you today! Sure, we’ve already had lot’s of fun using the VI Toolkit to find and manipulate all sort of settings. But do you know where to find the Virtual Center Server settings, which you access in the VI Client through the menu Administration -> VirtualCenter Management Server Configuration? You soon will!
Here’s an example that grabs the License Server setting for you:
$svcRef = new-object VMware.Vim.ManagedObjectReference
$svcRef.Type = “ServiceInstance”
$svcRef.Value = “ServiceInstance”
$serviceInstance = get-view $svcRef
$licRef = $serviceInstance.Content.LicenseManager
$LicMan = Get-View $licRef
Explore the $serviceInstance.Content property to get an idea for the other things you can access using this “trick”:
Imagine all the possibilities! You can expect more useful scripts from me in the days to come, so stay tuned!