PowerCLI
PowerCLI last patch date script to get VIB install date
· ☕ 1 min read · 🤖 Javy de Koning
PowerCLI last patch date You might find yourself wanting a report of when your vSphere servers have been patched for the last time. Here you will find a simple PowerCLI script that uses vSphere CLI to query the last VIB install date. PowerCLI script: Get-VMHost | ForEach-Object -Process { [PSCustomObject]@{ 'lastpatchdate' = [datetime]((Get-ESXCli -VMHost $_).software.vib.list() | Select-Object -Property installdate -ExpandProperty installdate | Sort-Object -Descending)[0] 'host' = $_.Name 'version' = $_.version 'build' = $_.

PowerCLI one-liner to validate ESXi root passwords.
· ☕ 2 min read · 🤖 Javy de Koning
Below is a PowerCLI one-liner you can use to validate if all your root passwords are what you expect them to be. get-vmhost | %{ $null = connect-viserver $_.name ` -user root -password "MyFakePassword" -EA 0 if (-not ($?)) { write-warning "Password failed for $($_.name)" } else { Disconnect-VIServer $_.name -force -confirm:$false } } Reset a known password over PowerCLI Below is a short code snippet to help you change your root password on ESXi hosts.