Verificando as WWN no Windows 2012 usando wmic
Autor: quirinobytes | Publicado: 2015-09-14T16:15:00-03:00

Verificando informações de WWN no Windows Server 2012

Testado no Windows Server 2012

Caso, vc não tenha acesso ou permissão ao sistema para usar os Consoles ou Programas para visualizar as informações da HBA, como WWN etc, poderá usar os comandos WMIC para realizar tal atividade, para tanto siga os passos abaixo:

- abrir o powershell do windows e executar o seguinte comando abaixo para ver algumas informações sobre as placas de HBA

$&gt; wmic /namespace:\\root\WMI PATH MSFC_FCAdapterHBAAttributes



Ou use o script (https://gallery.technet.microsoft.com/scriptcenter/Find-HBA-and-WWPN-53121140/view/Discussions) abaixo no PowerShell para declarar a função que exibe as informações sobre as WWN e chame a função abaixo:

$&gt; Get-HBAWin -ComputerName &lt;IP&gt;


function&nbsp;Get-HBAWin&nbsp;{&nbsp;&nbsp;
param(&nbsp;&nbsp;
[String[]]$ComputerName&nbsp;=&nbsp;$ENV:ComputerName,&nbsp;
[Switch]$LogOffline&nbsp;&nbsp;
)&nbsp;&nbsp;
&nbsp;&nbsp;
$ComputerName&nbsp;|&nbsp;ForEach-Object&nbsp;{&nbsp;&nbsp;
try&nbsp;{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;$Computer&nbsp;=&nbsp;$_&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;$Params&nbsp;=&nbsp;@{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Namespace&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;'root\WMI'&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;'MSFC_FCAdapterHBAAttributes'&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ComputerName&nbsp;=&nbsp;$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bsp;}#Foreach-Object(Adapter)&nbsp;&nbsp;
}#try&nbsp;
catch&nbsp;{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;Write-Warning&nbsp;-Message&nbsp;$_&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($LogOffline)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"$Computer&nbsp;is&nbsp;offline&nbsp;or&nbsp;not&nbsp;supported"&nbsp;&gt;&gt;&nbsp;"$home\desktop\Offline.txt"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;
}&nbsp;
&nbsp;
}#Foreach-Object(Computer)&nbsp;&nbsp;
&nbsp;&nbsp;
}#Get-HBAWin



Saida do Comando: