{"id":1092,"date":"2013-08-08T22:28:05","date_gmt":"2013-08-08T20:28:05","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=1092"},"modified":"2013-08-09T12:41:58","modified_gmt":"2013-08-09T10:41:58","slug":"windows-read-the-ip-address-of-a-bmc-board","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/windows-read-the-ip-address-of-a-bmc-board\/","title":{"rendered":"Windows: Read the IP Address of a BMC Board"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_1092 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_1092')){$('.twoclick_social_bookmarks_post_1092').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Windows%3A%20Read%20the%20IP%20Address%20of%20a%20BMC%20Board\",\"the_excerpt\":\"Most%20of%20the%20Serversystems%20have%20a%20Baseboard%20Management%20Controller%20%28BMC%29%20integrated%20for%20maintenace%20and%20management%20tasks.%0D%0A%0D%0ATypical%20functions%20are%2C%20indepentend%20from%20the%20running%20operating%20system%3A%0D%0A%0D%0A%09Shutdown%20and%20reboot%0D%0A%09Switch%20Power%20On%20and%20Off%0D%0A%09KVM%20%28Keyboard%2C%20Video%2C%20Mouse%29%20redirection%0D%0A%09Hardware%20monitoring%0D%0A%09USB%20redirection%2C%20connect%20the%20local%20DVD%20Drive%20to%20the%20Server%20over%20a%20LAN%20connection%0D%0A%09and%20%20...\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/windows-read-the-ip-address-of-a-bmc-board\\\/\",\"post_id\":1092,\"post_title_referrer_track\":\"Windows%3A+Read+the+IP+Address+of+a+BMC+Board\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Most of the Serversystems have a Baseboard Management Controller (BMC) integrated for maintenace and management tasks.<\/p>\n<p>Typical functions are, indepentend from the running operating system:<\/p>\n<ul>\n<li>Shutdown and reboot<\/li>\n<li>Switch Power On and Off<\/li>\n<li>KVM (Keyboard, Video, Mouse) redirection<\/li>\n<li>Hardware monitoring<\/li>\n<li>USB redirection, connect the local DVD Drive to the Server over a LAN connection<\/li>\n<li>and much more&#8230;<\/li>\n<\/ul>\n<p>Usually, the BMC has its own LAN Interface and therefore an own IP Address.<br \/>\n<!--more--><br \/>\nThe IP Address of the BMC can be read by the MICROSOFT_IPMI WMI Class in Namespace root\/wmi.\u00a0 Since Server 2008 the WMI IPMI Provider Class is shipped with the operating system. In Windows Server 2003 R2 you must add this manually:<\/p>\n<p>Go to <strong>Control Panel, Add\/Remove System Components<\/strong> and install the\u00a0<strong>Hardware Management<\/strong> feature under <strong>Management and Monitoring Tools.<\/strong><\/p>\n<p>The advantage of using the Microsoft WMI class is that this works manufacturer indepentent. Means it doesn&#8217;t matters wether the BMC, for example, is a Fujitsu iRMC or a HP iLO board.<\/p>\n<p>The following script reads the IP Address, Subnet mask and MAC Address of the first BMC found in the system.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n\r\n# Get the Class instance\r\n$oIPMI=Get-WmiObject -Namespace root\\WMI -Class MICROSOFT_IPMI\r\n# Some constants\r\n# &lt;a title=&quot;Microsoft In Band Management&quot; href=&quot;http:\/\/gallery.technet.microsoft.com\/scriptcenter\/In-Band-Management-using-88e221b8&quot; target=&quot;_blank&quot;&gt;Source&lt;\/a&gt;\r\n&#x5B;byte]$BMCResponderAddress = 0x20\r\n&#x5B;byte]$GetLANInfoCmd = 0x02\r\n&#x5B;byte]$GetChannelInfoCmd = 0x42\r\n&#x5B;byte]$SetSystemInfoCmd = 0x58\r\n&#x5B;byte]$GetSystemInfoCmd = 0x59\r\n&#x5B;byte]$DefaultLUN = 0x00\r\n&#x5B;byte]$IPMBProtocolType = 0x01\r\n&#x5B;byte]$8023LANMediumType = 0x04\r\n&#x5B;byte]$MaxChannel = 0x0b\r\n&#x5B;byte]$EncodingAscii = 0x00\r\n&#x5B;byte]$MaxSysInfoDataSize = 19\r\n\r\n<\/pre>\n<p>If you have administrator rights this works also on a remote machine. Just add the -ComputerName parameter when you get the WMI Class instance<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n$oIPMI=Get-WmiObject -Namespace root\\WMI -Class MICROSOFT_IPMI -ComputerName RemoteComputer\r\n<\/pre>\n<p>Finding the first LAN Channel<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n&#x5B;byte&#x5B;]]$RequestData=@(0)\r\n$oMethodParameter=$oIPMI.GetMethodParameters(&quot;RequestResponse&quot;)\r\n$oMethodParameter.Command=$GetChannelInfoCmd\r\n$oMethodParameter.Lun=$DefaultLUN\r\n$oMethodParameter.NetworkFunction=0x06\r\n$oMethodParameter.RequestData=$RequestData\r\n$oMethodParameter.RequestDataSize=$RequestData.length\r\n$oMethodParameter.ResponderAddress=$BMCResponderAddress\r\n# http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa392344%28v=vs.85%29.aspx\r\n$RequestData=@(0)\r\n&#x5B;Int16]$iLanChannel=0\r\n&#x5B;bool]$bFoundLAN=$false\r\nfor(;$iLanChannel -le $MaxChannel;$iLanChannel++){\r\n\t$RequestData=@($iLanChannel)\r\n\t$oMethodParameter.RequestData=$RequestData\r\n\t$oMethodParameter.RequestDataSize=$RequestData.length\r\n\t$oRet=$oIPMI.PSBase.InvokeMethod(&quot;RequestResponse&quot;,$oMethodParameter,(New-Object System.Management.InvokeMethodOptions))\r\n\t#$oRet\r\n\tif($oRet.ResponseData&#x5B;2] -eq $8023LANMediumType){\r\n\t\t$bFoundLAN=$true\r\n\t\tbreak;\r\n\t}\r\n}\r\n<\/pre>\n<p>If a LAN Channel is found get the Network parameters<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n\r\n$oMethodParameter.Command=$GetLANInfoCmd\r\n$oMethodParameter.NetworkFunction=0x0c\r\nif($bFoundLAN){\r\n\t$RequestData=@($iLanChannel,3,0,0)\r\n\t$oMethodParameter.RequestData=$RequestData\r\n\t$oMethodParameter.RequestDataSize=$RequestData.length\r\n\t$oRet=$oIPMI.PSBase.InvokeMethod(&quot;RequestResponse&quot;,$oMethodParameter,(New-Object System.Management.InvokeMethodOptions))\r\n\twrite-host (&quot;IP Address:     &quot;+$oRet.ResponseData&#x5B;2]+&quot;.&quot;+$oRet.ResponseData&#x5B;3]+&quot;.&quot;+$oRet.ResponseData&#x5B;4]+&quot;.&quot;+ $oRet.ResponseData&#x5B;5] )\r\n\t$RequestData=@($iLanChannel,6,0,0)\r\n\t$oMethodParameter.RequestData=$RequestData\r\n\t$oMethodParameter.RequestDataSize=$RequestData.length\r\n\t$oRet=$oIPMI.PSBase.InvokeMethod(&quot;RequestResponse&quot;,$oMethodParameter,(New-Object System.Management.InvokeMethodOptions))\r\n\twrite-host (&quot;Subnet Mask:    &quot;+$oRet.ResponseData&#x5B;2]+&quot;.&quot;+$oRet.ResponseData&#x5B;3]+&quot;.&quot;+$oRet.ResponseData&#x5B;4]+&quot;.&quot;+ $oRet.ResponseData&#x5B;5] )\r\n\t$RequestData=@($iLanChannel,5,0,0)\r\n\t$oMethodParameter.RequestData=$RequestData\r\n\t$oMethodParameter.RequestDataSize=$RequestData.length\r\n\t$oRet=$oIPMI.PSBase.InvokeMethod(&quot;RequestResponse&quot;,$oMethodParameter,(New-Object System.Management.InvokeMethodOptions))\r\n\t# Format http:\/\/msdn.microsoft.com\/en-us\/library\/dwhawy9k.aspx\r\n\twrite-host (&quot;MAC Address:    &quot;+(&quot;{0:x2}:{1:x2}:{2:x2}:{3:x2}:{4:x2}:{5:x2}&quot; -f $oRet.ResponseData&#x5B;2], $oRet.ResponseData&#x5B;3],$oRet.ResponseData&#x5B;4], $oRet.ResponseData&#x5B;5], $oRet.ResponseData&#x5B;6], $oRet.ResponseData&#x5B;7]))\r\n}\r\n\r\n<\/pre>\n<p>Have fun<br \/>\nMichael<\/p>\n<p>References<br \/>\n<a title=\"Microsoft_IPMI class\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa392342%28v=vs.85%29.aspx\" target=\"_blank\">MICROSOFT_IPMI WMI Provider<\/a><br \/>\n<a title=\"In-Band Management using IPMI and PowerShell\" href=\"http:\/\/gallery.technet.microsoft.com\/scriptcenter\/In-Band-Management-using-88e221b8\" target=\"_blank\"> In-Band Management using IPMI and PowerShell<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the Serversystems have a Baseboard Management Controller (BMC) integrated for maintenace and management tasks. Typical functions are, indepentend from the running operating system: Shutdown and reboot Switch Power On and Off KVM (Keyboard, Video, Mouse) redirection Hardware monitoring USB redirection, connect the local DVD Drive to the Server over a LAN connection and &hellip; <a href=\"https:\/\/michlstechblog.info\/blog\/windows-read-the-ip-address-of-a-bmc-board\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Windows: Read the IP Address of a BMC Board<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[274,273,276,278,275,277,279,133,20],"class_list":["post-1092","post","type-post","status-publish","format-standard","hentry","category-windowsknowhow","category-windowsscripts","tag-baseboard-management-controller","tag-bmc","tag-ilo","tag-ip-address","tag-irmc","tag-microsoft_ipmi","tag-network-parameters","tag-powershell","tag-windows-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=1092"}],"version-history":[{"count":15,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1092\/revisions"}],"predecessor-version":[{"id":1099,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1092\/revisions\/1099"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}