{"id":576,"date":"2015-03-04T15:18:34","date_gmt":"2015-03-04T15:18:34","guid":{"rendered":"http:\/\/giraffeit.com\/?p=576"},"modified":"2015-03-04T15:18:34","modified_gmt":"2015-03-04T15:18:34","slug":"psdns","status":"publish","type":"post","link":"https:\/\/giraffeit.com\/index.php\/2015\/03\/04\/psdns\/","title":{"rendered":"Powershell : renew remote IP address"},"content":{"rendered":"<p>We wrote this at GiraffeIT.com. If you know the remote IP or DNS name of a machine it will help you renew a DHCP lease and flush the DNS.<\/p>\n<p>Very useful if you have a remote machine with a scope change and its not being reflected.<\/p>\n<p>&nbsp;<\/p>\n<p>write-host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br \/>\nwrite-host &#8220;DHCP lease renewal + flushDNS&#8221;<br \/>\nwrite-host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br \/>\n$machine = read-host &#8220;IP\/Name of machine needing lease renewal ? &#8221;<br \/>\nGet-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $machine | Where { $_.IpEnabled -eq $true -and $_.DhcpEnabled -eq $true} | ForEach-Object -Process {$_.RenewDHCPLease()}<br \/>\nGet-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $machine | Where { $_.IpEnabled -eq $true -and $_.DhcpEnabled -eq $true} | ForEach-Object -Process {ipconfig \/flushdns}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We wrote this at GiraffeIT.com. If you know the remote IP or DNS name of a machine it will help you renew a DHCP lease and flush the DNS. Very useful if you have a remote machine with a scope change and its not being reflected. &nbsp; write-host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221; write-host &#8220;DHCP lease renewal + flushDNS&#8221; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/giraffeit.com\/index.php\/2015\/03\/04\/psdns\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Powershell : renew remote IP address&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","hentry","category-bog"],"_links":{"self":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":0,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"wp:attachment":[{"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/giraffeit.com\/index.php\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}