Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: Get System Boot Device

$
0
0

Thanks, LucD, for your replies.

 

I ultimately ended up with the following code to run through all hosts:

 

Function HostBootCheck {    Get-VMHost | Sort-Object -Property Name | ForEach-Object {        $vmhostname = $_.Name        $esxcli = $null        $esxcli = $_ | Get-EsxCli -ErrorAction SilentlyContinue        If ($esxcli -ne $null) {            Try {                $result = $esxcli.system.boot.device.get()                If ($result.BootFilesystemUUID -ne '') { $vmhostname + ' booted from disk (' + $result.BootFilesystemUUID + ')' }                If ($result.BootNIC -ne '') { $vmhostname + ' booted from the network (' + $result.BootNIC + ')' }            }            Catch {                $vmhostname + ': Boot device info unavailable'            }        } Else {            $vmhostname + ': Server unavailable'        }    }
}

Viewing all articles
Browse latest Browse all 252940

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>