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

Re: list of ESXi host and Manage Paths data

$
0
0

Sorry, I thought you ment the other script.

Try it like this

 

Write-Host "Connecting to vCenter" 
$VCent
= "10.2.160.250"
Connect-VIServer
$VCent -user user -password passwd
$VMHosts = Get-VMHost | Sort-Object Name
Disconnect-VIServer
-Server $VCent -Confirm:$False

$report
= @() ForEach ($VMHost in $VMHosts) {     $HostName = $VMHost.Name     Connect-VIServer $HostName -User root -password passwd
    $esxcli = Get-EsxCli  -VMHost $HostName
    $esxcli.corestorage.device.list() |     where {$_.IsLocal -eq "false" -and $_.DeviceType -eq "Direct-Access" -and $_.MultipathPlugin -eq "NMP"} | %{          $report += ($_ | Select @{N="Host";E={$hostName}},Device, MultipathPlugin)     }     Disconnect-VIServer -Server $HostName -Confirm:$False
} $report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture

 

You can try changing the Where-clause to see all multipath plugins.

 

    where {$_.IsLocal -eq "false" -and $_.DeviceType -eq "Direct-Access"} | %{
 

Viewing all articles
Browse latest Browse all 294344

Trending Articles



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