{"id":526,"date":"2012-10-16T10:56:50","date_gmt":"2012-10-16T15:56:50","guid":{"rendered":"http:\/\/www.brunerd.com\/blog\/?p=526"},"modified":"2012-10-16T10:58:17","modified_gmt":"2012-10-16T15:58:17","slug":"check-multiple-imacs-for-1tb-seagate-repair-program","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2012\/10\/16\/check-multiple-imacs-for-1tb-seagate-repair-program\/","title":{"rendered":"Check Multiple iMacs for 1TB Seagate Repair Program Eligibility"},"content":{"rendered":"<p>Apple recently announced that certain iMacs with 1TB Seagate hard drives are eligible for replacement. If you have one iMac it&#8217;s easy to check it on their website <a href=\"http:\/\/www.apple.com\/support\/imac-harddrive\/\" target=\"_blank\">here<\/a>.<\/p>\n<p>However if you have a lot of iMacs at your company you might prefer to do this a bit more quickly!\u00a0The following command can be sent via ARD:<\/p>\n<pre><code>curl \u00a0\"https:\/\/supportform.apple.com\/201107\/SerialNumberEligibilityAction.do?cb=iMacHDCheck.response&amp;sn=$(ioreg -c \"IOPlatformExpertDevice\" | awk -F '\"' '\/IOPlatformSerialNumber\/ {print $4}')\" 2&gt;\/dev\/null<\/code><\/pre>\n<p>To explain: It&#8217;s using curl to send a request to the Apple URL, the <em>sn=<\/em> field is populated with the results of the ioreg command, which is cleaned up with awk (thanks <a href=\"http:\/\/hints.macworld.com\/article.php?story=20040330144040245\" target=\"_blank\">OS X Hints<\/a>),\u00a0stderr of curl is sent to \/dev\/null so you don&#8217;t get the download\/progress output that curl usually displays.<\/p>\n<p>Another variation is if you already have a list of serial numbers, separated with some sort of whitespace. You can put them in a bash variable and loop though them locally:<\/p>\n<pre>serialNumbers=\"QP0231XXXPK\r\nQP0240XXYRU\r\nD25FP1TXXXJT\r\nQP6481XXXUW\"\r\n\r\nfor number in $serialNumbers; do echo $number $(curl \"https:\/\/supportform.apple.com\/201107\/SerialNumberEligibilityAction.do?cb=iMacHDCheck.response&amp;sn=$number\" 2&gt;\/dev\/null); done<\/pre>\n<p>This outputs the serial number queried and the response from the Apple server on each line. E03 the response you&#8217;ll be looking for.\u00a0I&#8217;ll leave it to you the reader if you want to do any additional cleanup of the output, here&#8217;s a sample:<\/p>\n<pre>QP0231XXXPK iMacHDCheck.response({\"ERROR_CODE\":\"E08\",\"ERROR_DESC\":\"Valid iMac SN but WoM is outside of program range\"})\r\nQP0240XXXRU iMacHDCheck.response({\"ERROR_CODE\":\"E03\",\"ERROR_DESC\":\"Valid iMac SN has Seagate HDD - covered by program\"})\r\nD25FP1TXXXJT iMacHDCheck.response({\"ERROR_CODE\":\"E07\",\"ERROR_DESC\":\"Valid iMac SN with NO Seagate HDD\"})\r\nQP6481XXXUW iMacHDCheck.response({\"ERROR_CODE\":\"E02\",\"ERROR_DESC\":\"Serial ID is not iMac.\"})<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apple recently announced that certain iMacs with 1TB Seagate hard drives are eligible for replacement. If you have one iMac it&#8217;s easy to check it on their website here. However if you have a lot of iMacs at your company you might prefer to do this a bit more quickly!\u00a0The following command can be sent [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","hentry","category-apple","category-scripting"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":8,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"predecessor-version":[{"id":533,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/526\/revisions\/533"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}