17 October 2016

Retrieve HBA information with powershell

$Params = @{
        Namespace = 'root\WMI'
        class = 'MSFC_FCAdapterHBAAttributes'
        ComputerName = $Computer
        ErrorAction = 'Stop'
}
 
$HBAAdapters = Get-WmiObject @Params

foreach($HBA in $HBAAdapters){
    $HBAInfo=@{
            ComputerName = $HBA.__SERVER
            NodeWWN = (($HBA.NodeWWN) | ForEach-Object {"{0:X2}" -f $_}) -join ":"
            Active = $HBA.Active
            DriverName = $HBA.DriverName
            DriverVersion = $HBA.DriverVersion
            FirmwareVersion = $HBA.FirmwareVersion
            Model = $HBA.Model
            ModelDescription = $HBA.ModelDescription
}
New-Object psobject -Property $HBAInfo

source

No comments:

Post a Comment