{"id":226,"date":"2014-04-30T11:50:31","date_gmt":"2014-04-30T11:50:31","guid":{"rendered":"http:\/\/www.pyrobrit.co.uk\/wordpress\/?p=226"},"modified":"2014-04-30T11:52:37","modified_gmt":"2014-04-30T11:52:37","slug":"clear-dns-entries-onnic","status":"publish","type":"post","link":"https:\/\/www.pyrobrit.co.uk\/wordpress\/2014\/04\/clear-dns-entries-onnic\/","title":{"rendered":"Clear DNS entries on NIC"},"content":{"rendered":"<p>Recently I have been seeing quite a few laptops arriving in the office with their NICs set to strange DNS entries. It appears that some home broadband routers are able to overwrite the DNS setting for a NIC and apply some strange IP range. The below script when applied in GPO will reset the DNS back to &#8220;obtain DNS server address automatically&#8221;.<!--more--><\/p>\n<p>If it fails bear in mind that it requires &#8220;elevated priviledges&#8221;. You can uncomment the wscript line which will give you an error code. 0 = success and 91 = access denied. For a full list of error codes, see this page here<\/p>\n<p><a title=\"Script Error codes\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa393295(v=vs.85).aspx\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/aa393295(v=vs.85).aspx<\/a><\/p>\n<pre>On Error Resume Next\r\n\r\nstrComputer = \".\"\r\n\r\nSet objWMIService = GetObject(\"winmgmts:\\\\\" &amp; strComputer &amp; \"\\root\\cimv2\")\r\n\r\nSet colNetCards = objWMIService.ExecQuery _\r\n\u00a0\u00a0\u00a0 (\"Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True\")\r\n\r\nFor Each objNetCard in colNetCards\r\n\u00a0\u00a0\u00a0 arrDNSServers = Array()\r\n\u00a0\u00a0\u00a0 objNetCard.SetDNSServerSearchOrder(arrDNSServers)\r\n'\u00a0\u00a0 \u00a0Wscript.Echo(objNetCard.SetDNSServerSearchOrder(arrDNSServers))\r\nNext<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recently I have been seeing quite a few laptops arriving in the office with their NICs set to strange DNS entries. It appears that some home broadband routers are able to overwrite the DNS setting for a NIC and apply some strange IP range. The below script when applied in GPO will reset the DNS <a href='https:\/\/www.pyrobrit.co.uk\/wordpress\/2014\/04\/clear-dns-entries-onnic\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,22],"tags":[25,23],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-pulp","category-scripts","tag-gpo","tag-script","category-4-id","category-22-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":7,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/226\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}