{"id":803,"date":"2020-07-16T08:15:19","date_gmt":"2020-07-16T06:15:19","guid":{"rendered":"https:\/\/wp.rimfalt.se\/?p=803"},"modified":"2020-10-26T13:45:43","modified_gmt":"2020-10-26T12:45:43","slug":"migrate-dhcp","status":"publish","type":"post","link":"https:\/\/wp.rimfalt.se\/?p=803","title":{"rendered":"Migrate DHCP"},"content":{"rendered":"\n<p>Just a quick reminder on how to quickly move a Microsoft DHCP server.<\/p>\n\n\n\n<p>Export with <br><code>netsh dhcp server export<\/code> backup.txt<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Import on new server with<br><code>netsh dhcp server import<\/code><br><br>dont forgett to &#8221;Authorize&#8221; correct server.<\/p>\n\n\n\n<p>Powershell way \ud83d\ude42<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">DHCP Migration\/Move to new Microsoft Server<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">Run this on the destination server..<\/h1>\n\n\n\n<p>#<\/p>\n\n\n\n<p>$SourceServer = &#8221;vdc01.byggkon.local&#8221;<br>$Sourceip =&#8221;192.168.52.10&#8243;<br>$DestServer =&#8221;vdc02&#8243;<br>$Destip =&#8221;192.168.52.11&#8243;<\/p>\n\n\n\n<p>$WorkDir = &#8221;c:\\DHCPMigration&#8221;<br>if (-not (test-path $workdir)) {md $workdir}<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Export config from old server<\/h1>\n\n\n\n<p>Export-DhcpServer -ComputerName $SourceServer -File &#8221;$Workdir\\SourceDHCPScopeData.xml&#8221; -Force<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Stop OLD DHCP Server &#8211; decommision<\/h2>\n\n\n\n<p>Stop-Service -InputObject $(Get-service -ComputerName $SourceServer -Name DHCPServer) #Stop service on Source<br>set-service -InputObject $(Get-service -ComputerName $SourceServer -Name DHCPServer) -StartupType disabled #Disable Service on Source<br>Remove-DhcpServerInDC -DnsName $SourceServer -IPAddress $Sourceip # Deauthorize in AD<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Importera den nya<\/h1>\n\n\n\n<p>Import-DhcpServer -ComputerName $DestServer -File &#8221;$Workdir\\SourceDHCPScopeData.xml&#8221; -BackupPath $workdir<br>Add-DhcpServerInDC -DnsName $DestServer # Authorize scope<\/p>\n\n\n\n<p>Get-DhcpServerInDC<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a quick reminder on how to quickly move a Microsoft DHCP server. Export with netsh dhcp server export backup.txt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[166,168,167,75,138],"class_list":["post-803","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-dhcp","tag-migrate","tag-migrera","tag-powershell","tag-windows-server"],"_links":{"self":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts\/803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=803"}],"version-history":[{"count":2,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts\/803\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts\/803\/revisions\/821"}],"wp:attachment":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}