{"id":4164,"date":"2022-06-09T09:22:27","date_gmt":"2022-06-09T16:22:27","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4164"},"modified":"2022-06-09T09:22:28","modified_gmt":"2022-06-09T16:22:28","slug":"how-to-set-dns-suffix-and-registration-using-powershell","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4164","title":{"rendered":"How to Set DNS Suffix and Registration Using PowerShell"},"content":{"rendered":"\n<p>This very simple PowerShell script can be used to set these options:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DNS Suffix for this connection<\/li><li>Register this connection\u2019s addresses in DNS<\/li><li>Use this connection\u2019s DNS suffix in DNS registration<\/li><\/ul>\n\n\n\n<p>I\u2019ve seen many questions online on how to use a script to mark the two checkboxes in this \u201cAdvanced TCP\/IP Settings\u201d window.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.boriskagan.net\/wp-content\/uploads\/2017\/02\/dns-suffix.png\" alt=\"\" class=\"wp-image-95\"\/><\/figure><\/div>\n\n\n<p>So here is the very short and simple PowerShell script:PowerShell<\/p>\n\n\n\n<p class=\"has-text-align-left\"><em><strong>$networkConfig = Get-WmiObject Win32_NetworkAdapterConfiguration -filter &#8220;ipenabled = &#8216;tr<\/strong><\/em><strong><em>ue'&#8221;<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong><em>$networkConfig.SetDnsDomain(&#8220;clients.ad.company.com&#8221;)<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong><em>$networkConfig.SetDynamicDNSRegistration($true,$true)<\/em><\/strong><\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong><em>ipconfig \/registerdns<\/em><\/strong><\/p>\n\n\n\n<p>The first line gets the adapters with a valid IP address. The second line sets the \u201cDNS suffix for this connection\u201d field. The third line enables each of the two checkboxes \u2013 if you change one of the $true values to $false, it will uncheck the corresponding checkbox. Finally, the last line simply updates the new settings in DNS without the need to restart the machine or anything like that.<\/p>\n\n\n\n<p>Ref:  https:\/\/www.boriskagan.net\/how-to-set-dns-suffix-and-registration-using-powershell\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This very simple PowerShell script can be used to set these options: DNS Suffix for this connection Register this connection\u2019s addresses in DNS Use this connection\u2019s DNS suffix in DNS registration I\u2019ve seen many questions online on how to use a script to mark the two checkboxes in this \u201cAdvanced TCP\/IP Settings\u201d window. So here <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4164\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,14,15],"tags":[1186,1187],"class_list":["post-4164","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-windows-7-8-10","category-windows-servers","tag-set-dns-suffix-and-registration-using-powershell","tag-set-dns-suffix-on-powershell"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4164"}],"version-history":[{"count":3,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions"}],"predecessor-version":[{"id":4178,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions\/4178"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}