- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not advised to bypass UAC using PowerShell. You would need to change registry values on the remote machine in order to achieve this.
Is it possible to have a service account with admin privileges' created for scripts to run under?
I have a code snippet that will set your VM to upgrade Tools on next OS reboot. You could easily modify this and use it how you want in your environment. I'm assuming your VMs reboot at least once a month for some sort of patching:
$ToolsAutoSettingsVMs = Get-Cluster | Get-VM | Sort | Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName", "Config.Tools.ToolsUpgradePolicy") | Select -Property Name, @{N="Configured OS";E={$_.Config.GuestFullName}}, @{N="Running OS";E={$_.Guest.GuestFullName}}, @{N='ToolsUpgradePolicy';E={$_.Config.Tools.ToolsUpgradePolicy }}
ForEach ($VM in ($ToolsAutoSettingVMs)){
$VMConfig = Get-View -VIObject $VM.Name
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$vmConfigSpec.Tools.ToolsUpgradePolicy = "UpgradeAtPowerCycle"
$VMConfig.ReconfigVM($vmConfigSpec)
}