Hi All,
Thanks in advance...
Is there any powershell script to check the Fnic & Enic version. Please correct my script I am not getting the desire out put.
$vCenter = Read-Host "Enter your ESX host name"
#Get-Credential
Connect-VIServer $vCenter
foreach ($VC in $VCList)
{
#Connecting to VC
Connect-VIServer -Server $VC -Protocol https
#Creating a text file to hold the output data
$esxuser = "esxuser"
$filename = $VC + "-hba.txt"
$plink = "C:\plink.exe"
$plinkoptions = "-pw pwd"
#Getting HBA details from each ESX hosts in a VC
$hbareport = @()
foreach($esxhost in Get-VMhost)
{
if($esxhost.state -eq "Connected")
{
$esxhost.Name | Out-File -FilePath .\$filename -Append
# $remotecommand = "'hostname; cat /proc/scsi/lpfc*/* | egrep -i adapter\|emulex\|4gb\|portname\|firmware\|link'"
$remotecommand = "'hostname; vmkload_mod -s fnic |grep Version'"
$command = $plink + " " + $esxuser + "@" + $esxhost + " " + $plinkoptions + " " +$remoteCommand
(Invoke-Expression -command $command) | Out-File -FilePath .\$filename -Append
"------------------------------------" | Out-File -FilePath .\$filename -Append
}
}
}
Disconnect-VIServer -Confirm:$false
Thanks
siv