VMware Cloud Community
paulc1
Enthusiast
Enthusiast
Jump to solution

Is there a way to pull bios.bootretry.enabled using PowerCLI?

Looks like a setting in the VMX file, but not listed in advancedsettings, so I'm not sure how to pull it. I see plenty of scripts to add stuff to a VMX, but I just want to get a list of all my VM's that have this enabled for an audit. We have some Citrix servers that get automatically rebooted and with this setting disabled they sometimes don't come up and cause SCOM alerts to generate high tickets, so I'm trying to audit all of our VM's and see which VM's have it and which ones don't. Preferably on a cluster or folder level.

Any tips are appreciated.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

This is in the VirtualMachineBootOptions property.

Get-VM |

Select Name, @{N = 'BootRetry'; E = { $_.ExtensionData.Config.BootOptions.BootRetryEnabled } }


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
paulc1
Enthusiast
Enthusiast
Jump to solution

I did find this and changed it to search by cluster, but it's going to take forever to copy each VMX.

$cluster = "Clustername"

$tgtFolder = "C:\Temp\VMX\"

$tgtString = 'bios.bootRetry.enabled = "TRUE"'

Get-Cluster $cluster | Get-VM | %{

  $dsName,$vmxPath = $_.ExtensionData.Config.Files.VmPathName.Split()

  $dsName = $dsName.Trim('[]')

  $ds = Get-Datastore -Name $dsName

  New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root "\" | Out-Null

  Copy-DatastoreItem -Item "DS:$vmxPath" -Destination $tgtFolder

  Remove-PSDrive -Name DS -Confirm:$false

}

Get-ChildItem -Path $tgtFolder -Filter "*.vmx" |

Where {Get-Content -Path $_.FullName | Select-String -Pattern $tgtString} |

Select Name

0 Kudos
LucD
Leadership
Leadership
Jump to solution

This is in the VirtualMachineBootOptions property.

Get-VM |

Select Name, @{N = 'BootRetry'; E = { $_.ExtensionData.Config.BootOptions.BootRetryEnabled } }


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
paulc1
Enthusiast
Enthusiast
Jump to solution

Thanks LuCD! I saw another one of your posts about the firmware settings that was almost identical to that little bit of code and for the life of me I couldn't figure out the syntax.

Appreciate all you do man, you make me look a lot smarter than I am to all my coworkers.

0 Kudos