Nov. 17th, 2017

nepilsonis: (Default)
Сегодня у меня на работе случилась истерика.

Понадобилось узнать WWN сервера с Windows 2012.
Гугление мгновенно показало, что...


WWNs of HBAs are always available in BIOS or the controller setup during pre-boot on servers that have them installed. How to view it depends on the manufacturer. You can also use a Powershell script to query WMI for that information. http://gallery.technet.microsoft.com/scriptcenter/Find-HBA-and-WWPN-53121140 has a script that will do this for you.

Marked as answer by Boo_MonstersIncMicrosoft contingent staff, Moderator Sunday, December 16, 2012 12:49 PM

Не откажу себе в удовольствии скопировать сюда текст скрипта по ссылке:
function Get-HBAWin {  
param(  
[String[]]$ComputerName = $ENV:ComputerName, 
[Switch]$LogOffline  
)  
  
$ComputerName | ForEach-Object {  
try { 
    $Computer = $_ 
     
    $Params = @{ 
        Namespace    = 'root\WMI' 
        class        = 'MSFC_FCAdapterHBAAttributes' 
        ComputerName = $Computer  
        ErrorAction  = 'Stop' 
        } 
     
    Get-WmiObject @Params  | ForEach-Object {  
            $hash=@{  
                ComputerName     = $_.__SERVER  
                NodeWWN          = (($_.NodeWWN) | ForEach-Object {"{0:X2}" -f $_}) -join ":"  
                Active           = $_.Active  
                DriverName       = $_.DriverName  
                DriverVersion    = $_.DriverVersion  
                FirmwareVersion  = $_.FirmwareVersion  
                Model            = $_.Model  
                ModelDescription = $_.ModelDescription  
                }  
            New-Object psobject -Property $hash  
        }#Foreach-Object(Adapter)  
}#try 
catch { 
    Write-Warning -Message $_ 
    if ($LogOffline) 
    { 
        "$Computer is offline or not supported" >> "$home\desktop\Offline.txt" 
    } 
} 
 
}#Foreach-Object(Computer)  
  
}#Get-HBAWin


Там же по ссылке был и вариант чуть покороче:

you may use the PowerShell command, Get-WmiObject to retrieved the information in Windows Server 2012.

For example:

Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace "root\WMI" | ForEach-Object {(($_.NodeWWN) | ForEach-Object {"{0:x}" -f $_}) -join ":"}


If you need assistance with PowerShell, this forum could help you.

http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell

Hope this helps.


Да, они охуели. И что?
Ничего.

Expand Cut Tags

No cut tags

Profile

nepilsonis: (Default)
nepilsonis

December 2025

M T W T F S S
12 34567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Page Summary

Style Credit

Page generated Jan. 6th, 2026 00:14
Powered by Dreamwidth Studios