{"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><\/div>\n<p>With a single command you can retrieve WWN\u2019s on Windows Server 2012 R2 using PowerShell.<\/p>\n<p>Open the PowerShell command and type:<\/p>\n<p><strong>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<p>And that is all there is to it. Simple and fast using PowerShell.<\/p>\n<p><strong>Update:<\/strong>\u00a0I have been been made aware of another way to get the WWN on Windows 2012 R2 with a cmdlet called\u00a0<strong>get-initiatorport<\/strong>\u00a0which was added to Windows Server 2012 R2. This is a much cleaner way of retrieving the WWN\u00a0<span class=\"vm-hook-outer vm-hook-default\"><span class=\"vm-hook\">information<\/span><\/span>\u00a0instead of the WMI call.<\/p>\n<p>&nbsp;<\/p>\n<pre>PS C:\\&gt; Get-InitiatorPort\r\n\r\nInstanceName NodeAddress PortAddress ConnectionType\r\n------------ ----------- ----------- --------------\r\nPCI\\VEN_10DF&amp;DEV_F100&amp;SUBS... 20000090fa56b930 10000090fa56b930 Fibre Channel\r\nPCI\\VEN_10DF&amp;DEV_F100&amp;SUBS... 20000090fa56b931 10000090fa56b931 Fibre Channel<\/pre>\n<p>You can also filter the\u00a0<span class=\"vm-hook-outer vm-hook-default\"><span class=\"vm-hook\">display<\/span><\/span>\u00a0and just get the PortAddress<\/p>\n<pre>PS C:\\&gt; Get-InitiatorPort | Select-Object -Property PortAddress | Format-Table -AutoSize\r\n\r\nPortAddress\r\n-----------\r\n10000090fa56b930\r\n10000090fa56b931<\/pre>\n<p>More information on get-initiatorport and many other\u00a0<span class=\"vm-hook-outer vm-hook-default\"><span class=\"vm-hook\">storage<\/span><\/span>\u00a0related cmdlets can be found\u00a0<a href=\"https:\/\/technet.microsoft.com\/en-us\/%5Clibrary\/hh848671(v=wps.630).aspx\" target=\"_blank\" rel=\"noopener\">here<\/a>!<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/lifeofageekadmin.com\/finding-wwns-windows-server-2012-using-powershell\/\">Site<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,11],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-powershell-script"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_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}]}}