{"id":259,"date":"2018-03-08T09:32:28","date_gmt":"2018-03-08T08:32:28","guid":{"rendered":"https:\/\/blog.van-daag.nl\/?p=259"},"modified":"2018-03-08T09:33:00","modified_gmt":"2018-03-08T08:33:00","slug":"259","status":"publish","type":"post","link":"https:\/\/van-daag.nl\/?p=259","title":{"rendered":"Finding WWN\u2019s on Windows Server 2012 Using PowerShell"},"content":{"rendered":"
<\/div>\n

With a single command you can retrieve WWN\u2019s on Windows Server 2012 R2 using PowerShell.<\/p>\n

Open the PowerShell command and type:<\/p>\n

Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace \u201croot\\WMI\u201d | ForEach-Object {(($_.NodeWWN) | ForEach-Object {\u201c{0:x}\u201d -f $_}) -join \u201c:\u201d}<\/strong><\/p>\n

And that is all there is to it. Simple and fast using PowerShell.<\/p>\n

Update:<\/strong>\u00a0I have been been made aware of another way to get the WWN on Windows 2012 R2 with a cmdlet called\u00a0get-initiatorport<\/strong>\u00a0which was added to Windows Server 2012 R2. This is a much cleaner way of retrieving the WWN\u00a0information<\/span><\/span>\u00a0instead of the WMI call.<\/p>\n

 <\/p>\n

PS C:\\> Get-InitiatorPort\r\n\r\nInstanceName NodeAddress PortAddress ConnectionType\r\n------------ ----------- ----------- --------------\r\nPCI\\VEN_10DF&DEV_F100&SUBS... 20000090fa56b930 10000090fa56b930 Fibre Channel\r\nPCI\\VEN_10DF&DEV_F100&SUBS... 20000090fa56b931 10000090fa56b931 Fibre Channel<\/pre>\n

You can also filter the\u00a0display<\/span><\/span>\u00a0and just get the PortAddress<\/p>\n

PS C:\\> Get-InitiatorPort | Select-Object -Property PortAddress | Format-Table -AutoSize\r\n\r\nPortAddress\r\n-----------\r\n10000090fa56b930\r\n10000090fa56b931<\/pre>\n

More information on get-initiatorport and many other\u00a0storage<\/span><\/span>\u00a0related cmdlets can be found\u00a0here<\/a>!<\/p>\n

 <\/p>\n

Site<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

With a single command you can retrieve WWN\u2019s on Windows Server 2012 R2 using PowerShell. Open the PowerShell command and type: Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace \u201croot\\WMI\u201d | ForEach-Object {(($_.NodeWWN) | ForEach-Object {\u201c{0:x}\u201d -f $_}) -join \u201c:\u201d} And that is all there is to it. Simple and fast using PowerShell. Update:\u00a0I have been been made aware […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6,11],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-powershell-script"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":2,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/van-daag.nl\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/261"}],"wp:attachment":[{"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/van-daag.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}