VMware Cloud Community
anthonyhwynn
Contributor
Contributor
Jump to solution

script add vm logrotate Size ="10240000"

anyone have the script for this add this to all the vm  logrotate Size ="10240000"  add another line rotate =3  please let me know thanks

0 Kudos
1 Solution

Accepted Solutions
IRIX201110141
Champion
Champion
Jump to solution

Something like this when there already is a value for existing parameter.

Connect-VIServer -Server "myvcsaoresxi" -User "administrator@vsphere.local" -Password "topsecret"
$vms = Get-VM
foreach($vm in $vms) {
  Get-VM -Name $vm.Name | Get-AdvancedSetting -Name "config parameter name" | Set-AdvancedSetting -value "value" -Confirm:$false
}




You need to install VMware vSphere PowerCLI on your favorite Windows VM/PC.  Yes.... there is also Powershell for Linux but on Windows its paste&run.

Regards,
Joerg

View solution in original post

0 Kudos
5 Replies
scott28tt
VMware Employee
VMware Employee
Jump to solution

To a bunch of VMX files? Where do you want the script to run from?


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
berndweyand
Expert
Expert
Jump to solution

0 Kudos
anthonyhwynn
Contributor
Contributor
Jump to solution

run from vCenter?

0 Kudos
IRIX201110141
Champion
Champion
Jump to solution

Something like this when there already is a value for existing parameter.

Connect-VIServer -Server "myvcsaoresxi" -User "administrator@vsphere.local" -Password "topsecret"
$vms = Get-VM
foreach($vm in $vms) {
  Get-VM -Name $vm.Name | Get-AdvancedSetting -Name "config parameter name" | Set-AdvancedSetting -value "value" -Confirm:$false
}




You need to install VMware vSphere PowerCLI on your favorite Windows VM/PC.  Yes.... there is also Powershell for Linux but on Windows its paste&run.

Regards,
Joerg

0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

Moderator: Thread moved to the PowerCLI area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos