{"id":361,"date":"2012-09-03T13:56:00","date_gmt":"2012-09-03T17:56:00","guid":{"rendered":"http:\/\/rajdude.com\/blog\/?p=361"},"modified":"2012-09-04T14:02:24","modified_gmt":"2012-09-04T18:02:24","slug":"set-dynamic-ip-address-using-powershell","status":"publish","type":"post","link":"https:\/\/rajdude.com\/blog\/set-dynamic-ip-address-using-powershell\/","title":{"rendered":"Set Dynamic IP address using powershell"},"content":{"rendered":"<p>Here is a quick powershell script to set your network card TCP\/IP setting to dynamic addressing:<\/p>\n<p><span style=\"color: #ff0000\">$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq \u201cTRUE\u201d} <\/span><\/p>\n<p><span style=\"color: #ff0000\">Foreach($NIC in $NICs) <\/span><\/p>\n<p><span style=\"color: #ff0000\">{ <\/span><\/p>\n<p><span style=\"color: #ff0000\">$NIC.EnableDHCP() <\/span><\/p>\n<p><span style=\"color: #ff0000\">$NIC.SetDNSServerSearchOrder() <\/span><\/p>\n<p><span style=\"color: #ff0000\">}<\/span><\/p>\n<p><span style=\"color: #ff0000\">IPConfig \/all<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Credits: Original script taken <a href=\"http:\/\/blogs.technet.com\/b\/danstolts\/archive\/2012\/01\/31\/using-powershell-to-get-or-set-networkadapterconfiguration-view-and-change-network-settings-including-dhcp-dns-ip-address-and-more-dynamic-and-static-step-by-step.aspx\" target=\"_blank\">from here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a quick powershell script to set your network card TCP\/IP setting to dynamic addressing: $NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq \u201cTRUE\u201d} Foreach($NIC in $NICs) { $NIC.EnableDHCP() $NIC.SetDNSServerSearchOrder() } IPConfig \/all &nbsp; Credits: Original script taken from here<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[48,29],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-itsys","tag-powershell","tag-system-administration"],"_links":{"self":[{"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":7,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":366,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions\/366"}],"wp:attachment":[{"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rajdude.com\/blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}