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

Понадобилось узнать 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.


Да, они охуели. И что?
Ничего.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Expand Cut Tags

No cut tags

Profile

nepilsonis: (Default)
nepilsonis

December 2024

M T W T F S S
       1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Page generated Jun. 14th, 2025 19:29
Powered by Dreamwidth Studios