{"id":3388,"date":"2019-10-04T16:39:48","date_gmt":"2019-10-04T15:39:48","guid":{"rendered":"http:\/\/www.edwardsd.co.uk\/work\/?p=3388"},"modified":"2020-04-06T14:32:18","modified_gmt":"2020-04-06T13:32:18","slug":"windows-dhcp-powershell-options-cheatsheet","status":"publish","type":"post","link":"https:\/\/www.edwardsd.co.uk\/work\/2019\/10\/windows-dhcp-powershell-options-cheatsheet\/","title":{"rendered":"Windows | DHCP PowerShell Options (Cheatsheet)"},"content":{"rendered":"<p><strong>Managing DHCP on DHCP server:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Add-WindowsFeature -Name DHCP \u2013IncludeManagementTools<\/pre>\n<p><strong>Managing DHCP on remote host:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Add-WindowsFeature RSAT-DHCP<\/pre>\n<p><strong>Powershell DHCP Module:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Import-Module DhcpServer<\/pre>\n<p><strong>Get all DHCP servers in AD<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-DhcpServerInDC<\/pre>\n<p><strong>Get DHCP scope configuration<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-DhcpServerv4Scope \u2013ComputerName &lt;DHCPServerName&gt;<\/pre>\n<p><strong>Get DHCP reservations on scope:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-DhcpServerv4Reservation -ComputerName &lt;DHCPServerName&gt; -ScopeId &lt;ScopeID&gt;<\/pre>\n<p><strong>Import\/Export DHCP Scopes<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">netsh dhcp server export C:\\temp\\DHCP.txt all<\/pre>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">netsh dhcp server import C:\\temp\\DHCP.txt all<\/pre>\n<p>Note: The temp folder needs to be created<\/p>\n<p><strong>Check DHCP Replication Failover Status<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Get-DhcpServerv4Failover -ComputerName &lt;DHCPServerName&gt;<\/pre>\n<p><strong>Reference:<\/strong><br \/>\nhttps:\/\/technet.microsoft.com\/en-us\/library\/jj590708(v=wps.630).aspx<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing DHCP on DHCP server: Add-WindowsFeature -Name DHCP \u2013IncludeManagementTools Managing DHCP on remote host: Add-WindowsFeature RSAT-DHCP Powershell DHCP Module: Import-Module DhcpServer Get all DHCP servers in AD Get-DhcpServerInDC Get DHCP scope configuration Get-DhcpServerv4Scope \u2013ComputerName &lt;DHCPServerName&gt; Get DHCP reservations on scope: Get-DhcpServerv4Reservation -ComputerName &lt;DHCPServerName&gt; -ScopeId &lt;ScopeID&gt; Import\/Export DHCP Scopes netsh dhcp server export C:\\temp\\DHCP.txt all netsh [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30,44,51,54],"tags":[],"class_list":["post-3388","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows-server-2012","category-windows-server-2016","category-windows-server-2019"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pOPt8-SE","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/comments?post=3388"}],"version-history":[{"count":10,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3388\/revisions"}],"predecessor-version":[{"id":3615,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3388\/revisions\/3615"}],"wp:attachment":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/media?parent=3388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/categories?post=3388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/tags?post=3388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}