{"id":484,"date":"2014-10-24T11:59:00","date_gmt":"2014-10-24T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/10\/24\/powertip-use-powershell-to-keep-servers-correctly-configured\/"},"modified":"2014-10-24T11:59:00","modified_gmt":"2014-10-24T11:59:00","slug":"powertip-use-powershell-to-keep-servers-correctly-configured","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-powershell-to-keep-servers-correctly-configured\/","title":{"rendered":"PowerTip: Use PowerShell to Keep Servers Correctly Configured"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: How do I keep my servers configured correctly?<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;I can write Windows PowerShell scripts to configure my machines, but how do I enforce these configurations <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;after the script has finished?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;This situation is called &quot;configuration drift.&quot; You&rsquo;ve set up your server properly, and then over time, <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;little changes are made that lead to an unknown production state. To manage configuration drift, <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use Desired State Configuration (DSC).<\/p>\n<p style=\"margin-left:30px\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DSC allows you to write your desired configuration in an easy-to-understand <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form, and then DSC takes care of periodically checking the state of your server to see if it matches the desired <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;state. If it doesn&rsquo;t, you can configure DSC to automatically fix the issues, or to simply report that something <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;has changed.<\/p>\n<p style=\"margin-left:30px\"><b>Note&nbsp;<\/b>&nbsp;Today&rsquo;s PowerTip is provided by Windows PowerShell MVP, Dave Wyatt.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: How do I keep my servers configured correctly? &nbsp;I can write Windows PowerShell scripts to configure my machines, but how do I enforce these configurations &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;after the script has finished? &nbsp;This situation is called &quot;configuration drift.&quot; You&rsquo;ve set up your server properly, and then over time, &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[501,56,356,3,45],"class_list":["post-484","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-dave-wyatt","tag-guest-blogger","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: How do I keep my servers configured correctly? &nbsp;I can write Windows PowerShell scripts to configure my machines, but how do I enforce these configurations &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;after the script has finished? &nbsp;This situation is called &quot;configuration drift.&quot; You&rsquo;ve set up your server properly, and then over time, &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}