Is there any way to configure virtual machines configuration parameters globally? Instead of going into the VIC and changing each one? I have a lot of rules that need to apply to every VM in my environment.
Thanks,
Ryan
You could do this for all your guests in the VC this way:
get-vm | %{ $vm = $_ | Get-View $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec $vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue $vmConfigSpec.extraconfig[0].Key = "isolation.tools.paste.disable" $vmConfigSpec.extraconfig[0].Value = "True" $vm.ReconfigVM($vmConfigSpec) }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can use the VI Perl toolkit or powershell to easily script changes such as the ones you are likely wanting to make.
The powershell toolkit is probably the easiest to start with:
Perl Toolkit can be found here:
If you found this helpful, please consider awarding points
can you be a little more detailed. What exactly are you trying to accomplish?
One example would be to set the configuration parameter 'isolation.tools.paste.disable' with a value of 'true' for all VM's.
Does anyone have any insight on this?
You could do this for all your guests in the VC this way:
get-vm | %{ $vm = $_ | Get-View $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec $vmConfigSpec.extraconfig += New-Object VMware.Vim.optionvalue $vmConfigSpec.extraconfig[0].Key = "isolation.tools.paste.disable" $vmConfigSpec.extraconfig[0].Value = "True" $vm.ReconfigVM($vmConfigSpec) }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Amazing.
Thank you so much.