{"id":1951,"date":"2013-11-26T11:31:00","date_gmt":"2013-11-26T11:31:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2013\/11\/26\/push-and-pull-configuration-modes\/"},"modified":"2024-02-22T15:08:12","modified_gmt":"2024-02-22T23:08:12","slug":"push-and-pull-configuration-modes","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/push-and-pull-configuration-modes\/","title":{"rendered":"Push and Pull Configuration Modes"},"content":{"rendered":"<p>\/\/ bw + bsl &amp;&amp; x + aw &#8211; ah \/ 2 &#8211; cw &gt;= bsl )\n{ c.style.left = x + aw &#8211; ah \/ 2 &#8211; cw; }\nelse\n{ c.style.left = x + ah \/ 2; }\nif (y + ch + ah \/ 2 &gt; bh + bst &amp;&amp; y + ah \/ 2 &#8211; ch &gt;= bst )\n{ c.style.top = y + ah \/ 2 &#8211; ch; }\nelse\n{ c.style.top = y + ah \/ 2; }\nc.style.visibility = &#8220;visible&#8221;;\n} } }\nfunction msoCommentHide(com_id)\n{\nif(msoBrowserCheck())\n{\nc = document.all(com_id);\nif (null != c &amp;&amp; null == c.length)\n{\nc.style.visibility = &#8220;hidden&#8221;;\nc.style.left = -1000;\nc.style.top = -1000;\n} }\n}\nfunction msoBrowserCheck()\n{\nms = navigator.appVersion.indexOf(&#8220;MSIE&#8221;);\nvers = navigator.appVersion.substring(ms + 5, ms + 6);\nie4 = (ms &gt; 0) &amp;&amp; (parseInt(vers) &gt;= 4);\nreturn ie4;\n}\nif (msoBrowserCheck())\n{\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomanchor&#8221;,&#8221;background: infobackground&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomoff&#8221;,&#8221;display: none&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;visibility: hidden&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;position: absolute&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;top: -1000&#8243;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;left: -1000&#8243;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;width: 33%&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;background: infobackground&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;color: infotext&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;border-top: 1pt solid threedlightshadow&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;border-right: 2pt solid threedshadow&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;border-bottom: 2pt solid threedshadow&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;border-left: 1pt solid threedlightshadow&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;padding: 3pt 3pt 3pt 3pt&#8221;);\ndocument.styleSheets.dynCom.addRule(&#8220;.msocomtxt&#8221;,&#8221;z-index: 100&#8243;);\n}\n\/\/ ]]&gt;<\/p>\n<div class=\"WordSection1\">\n<p class=\"MsoTitle\">Windows PowerShell Desired State Configuration: Push and Pull Configuration Modes<\/p>\n<h2>What are push and pull modes?<\/h2>\n<p class=\"MsoNormal\">The Windows PowerShell Desired State Configuration (DSC) system has two configuration modes, which are referred to as <em>push<\/em> and <em>pull<\/em> modes. Each mode allows the user to apply a desired state over a target node.<\/p>\n<h2>Push mode vs. pull mode<\/h2>\n<p class=\"MsoNormal\">How push mode works<\/p>\n<p class=\"MsoNormal\"><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/3122.push_graphic_thumb_7B1EB0FA.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20355\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/3122.push_graphic_thumb_7B1EB0FA.png\" alt=\"Image 3122 push graphic thumb 7B1EB0FA\" width=\"747\" height=\"445\" srcset=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/3122.push_graphic_thumb_7B1EB0FA.png 747w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/3122.push_graphic_thumb_7B1EB0FA-300x179.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p class=\"MsoNormal\">As illustrated in the preceding diagram, the push model is unidirectional and immediate. . The configuration is pushed to its intended targets, and they are configured.<\/p>\n<h3>How to push a configuration<\/h3>\n<p class=\"MsoNormal\">In push mode, the user initiates configuration processing via the <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn407380(v=wps.630).aspx\">Start-DscConfiguration<\/a> cmdlet. This command <span style=\"text-decoration: underline;\">immediately<\/span> applies the configuration to the target, which can be specified by the &#8211;<strong>ComputerName<\/strong> parameter of the Start-DscConfiguration DSC cmdlet. By default, this cmdlet uses the files in the -Path folder to find the target node details.<\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\">How pull mode works<\/p>\n<p class=\"MsoNormal\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/7824.pull_graphic_thumb_0CFB44C8.png\"><img decoding=\"async\" title=\"pull_graphic\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/7824.pull_graphic_thumb_0CFB44C8.png\" alt=\"pull_graphic\" width=\"693\" height=\"421\" border=\"0\" \/><\/a><\/p>\n<p class=\"MsoNormal\">In the preceding diagram, we have 4 machines that participate in the request, delivery and application of the configuration. Each one of the pull client machines is configured to get its desired state configuration from the pull server. Likewise, the pull server has been set up to host the DSC service, and has been provisioned with the configurations and resources that are required by the pull clients.<\/p>\n<p class=\"MsoNormal\">Each one of the pull clients has a scheduled task that performs a periodic compliance check on the configuration of the node. When the event is triggered the first time, it causes the Local Configuration Manager (<strong>LCM<\/strong>) on the pull client to validate the configuration. If the pull client is configured as desired, nothing happens. Otherwise, the LCM makes a request to the pull server to get a given configuration. If that configuration exists on the pull server, and it passes initial validation checks, the configuration is transmitted to the pull client, where it is then executed by the LCM.<\/p>\n<h3>How to pull a configuration<\/h3>\n<p class=\"MsoNormal\">Pulling a configuration requires that a series of steps be taken on the pull server and target nodes. We will look at this series of steps in detail in the section titled The pull mode configuration steps<span class=\"GramE\"><span class=\"MsoCommentReference\"><span style=\"line-height: 106%; font-family: 'Calibri','sans-serif'; font-size: 8pt;\">\u00a0<\/span><\/span> in<\/span> this post.<\/p>\n<p>&#8230;&#8230;&#8230;.<\/p>\n<p>NOTE ADDED 2\/6\/2018 &#8211;\u00a0The latest information regarding DSC Pull Service can be found in the DSC documentation using the link:\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/dsc\/pullserver\">https:\/\/docs.microsoft.com\/en-us\/powershell\/dsc\/pullserver<\/a><\/p>\n<p><strong>\u00a0&#8230;&#8230;&#8230;.<\/strong><\/p>\n<h2><strong>Push and pull configuration deployment steps<\/strong><\/h2>\n<h2>Push sequence<\/h2>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/0871.push_flow_graphic_thumb_7AB27E05.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20357\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/0871.push_flow_graphic_thumb_7AB27E05.png\" alt=\"Image 0871 push flow graphic thumb 7AB27E05\" width=\"823\" height=\"379\" srcset=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/0871.push_flow_graphic_thumb_7AB27E05.png 823w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/0871.push_flow_graphic_thumb_7AB27E05-300x138.png 300w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2013\/11\/0871.push_flow_graphic_thumb_7AB27E05-768x354.png 768w\" sizes=\"(max-width: 823px) 100vw, 823px\" \/><\/a><\/p>\n<h3>Authoring a configuration<\/h3>\n<p class=\"MsoNormal\">First thing to do when configuring nodes through DSC is to define a configuration. Consider the following example, and then we\u2019ll examine each part of the configuration.<\/p>\n<p class=\"MsoNormal\"><strong>InstallDscService.ps1<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"color: darkblue; font-family: 'Lucida Console'; font-size: 9pt;\">configuration<\/span><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\"> <span style=\"color: blueviolet;\">InstallDSCService<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">{ <\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 node <span style=\"color: blueviolet;\">localhost<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 {\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 WindowsFeature <span style=\"color: blueviolet;\">DSCService<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Name\u00a0 <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;DSC-Service&#8221;<\/span> <\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Ensure <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;Present&#8221;<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">}<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"color: blue; font-family: 'Lucida Console'; font-size: 9pt;\">InstallDSCService<\/span><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\"> <span style=\"color: navy;\">-output<\/span> <span style=\"color: darkred;\">&#8220;.&#8221;<\/span>\u00a0 <\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\">In this simple example, we have the following main elements:<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\">a)<span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>The <strong>configuration<\/strong> <em>keyword<\/em>, followed by a user-supplied name.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\">b)<span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>The <strong>Node<\/strong> <em>keyword<\/em>, followed by the name of the node to be configured. In this case, it is the localhost. Note that the Node keyword is not case-sensitive.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\">c)<span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>Within the scope of the node definition, we list the resources we will use to configure the node. In this case, we are using the <strong>WindowsFeature<\/strong> built-in resource provider to install the DSC Service feature on the local machine.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\">d)<span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>Finally, we have a statement making an invocation of the configuration, designating the location of the .mof output as the current directory.<\/p>\n<h3>Generate configuration MOF file<\/h3>\n<p class=\"MsoNormal\">Now that we have our .ps1 file with the configuration defined above, we need to generate the MOF file that we will use to initiate the configuration. To generate the MOF file, all that is needed is to execute the .ps1 file containing the configuration. This generates a MOF file named with the same name as the node within the configuration, with the .mof file name extension. In this case, we\u2019ll end up with <span class=\"SpellE\">localhost.mof<\/span>.<\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">PS <span class=\"GramE\">D:<\/span>\\&gt; .\\InstallDscService.ps1<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 Directory: D:\\InstallDscService<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">Mode\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span class=\"SpellE\">LastWriteTime<\/span>\u00a0\u00a0\u00a0\u00a0 Length Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">&#8212;-\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212;&#8212;&#8212;&#8212;-\u00a0\u00a0\u00a0\u00a0 &#8212;&#8212; &#8212;-\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">-a&#8212;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8\/28\/2013\u00a0\u00a0 4:17 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1260 localhost.mof\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/p>\n<h3>Push the desired configuration to target nodes<\/h3>\n<p class=\"MsoNormal\">Once we have the configuration mof file generated, we are ready to start the configuration using the <strong>Start-DscConfiguration<\/strong> command. In the following example, we provide a few extra parameters, explained below.<\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">PS D:\\InstallDscService&gt; Start-DscConfiguration -Wait -Verbose -ComputerName localhost &#8211;<span class=\"GramE\">Path .<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: Perform operation &#8216;Invoke <span class=\"SpellE\">CimMethod<\/span>&#8216; with the following parameters, &#8221;<span class=\"SpellE\">methodName<\/span>&#8216; = <span class=\"SpellE\">SendConfigurationApply<\/span>,&#8217;<span class=\"SpellE\">className<\/span>&#8216; = MSFT_<span class=\"SpellE\">DSCLocalConfigurationManager<\/span>,&#8217;<span class=\"SpellE\">namespaceName<\/span>&#8216; = root\/Microsoft\/Windows\/<span class=\"SpellE\">DesiredStateConfiguration<\/span>&#8216;.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: An LCM method call arrived from computer LOUISC-VMHOSTD with user <span class=\"SpellE\"><span class=\"GramE\">sid<\/span><\/span> S-1-5-21-2800768176-829124343-4290817346-1106.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ Start<\/span>\u00a0 Set\u00a0\u00a0\u00a0\u00a0\u00a0 ]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ Start<\/span>\u00a0 Resource ]\u00a0 [[WindowsFeature]<span class=\"SpellE\">DSCService<\/span>]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ Start<\/span>\u00a0 Test\u00a0\u00a0\u00a0\u00a0 ]\u00a0 [[WindowsFeature]<span class=\"SpellE\">DSCService<\/span>]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [[WindowsFeature<span class=\"GramE\">]<span class=\"SpellE\">DSCService<\/span><\/span>] The operation &#8216;Get-WindowsFeature&#8217; started: DSC-Service<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [[WindowsFeature<span class=\"GramE\">]<span class=\"SpellE\">DSCService<\/span><\/span>] The operation &#8216;Get-WindowsFeature&#8217;<\/span><span class=\"MsoCommentReference\"><span style=\"font-family: 'Calibri','sans-serif'; font-size: 8pt;\">\u00a0<\/span><\/span><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">succeeded: DSC-Service<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ End<\/span>\u00a0\u00a0\u00a0 Test\u00a0\u00a0\u00a0\u00a0 ]\u00a0 [[WindowsFeature]<span class=\"SpellE\">DSCService<\/span>]\u00a0 in 1.6720 seconds.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ Skip<\/span>\u00a0\u00a0 Set\u00a0\u00a0\u00a0\u00a0\u00a0 ]\u00a0 [[WindowsFeature]<span class=\"SpellE\">DSCService<\/span>]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ End<\/span>\u00a0\u00a0\u00a0 Resource ]\u00a0 [[WindowsFeature]<span class=\"SpellE\">DSCService<\/span>]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ End<\/span>\u00a0\u00a0\u00a0 Set\u00a0\u00a0\u00a0\u00a0\u00a0 ]<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: [LOUISC-VMHOSTD]: LCM:\u00a0 <span class=\"GramE\">[ End<\/span>\u00a0\u00a0\u00a0 Set\u00a0\u00a0\u00a0\u00a0\u00a0 ]\u00a0\u00a0\u00a0 in\u00a0 2.3120 seconds.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: Operation &#8216;Invoke <span class=\"SpellE\">CimMethod<\/span>&#8216; complete.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: Time taken for configuration job to complete is 2.365 seconds<\/span><\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\"><span style=\"font-family: symbol;\">\u00b7<\/span><span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>&#8211;<strong>Wait<\/strong>: This parameter ensures that the invocation of configuration is interactive and synchronous with user commands. Otherwise, a job object is returned that continues the operation in the background.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\"><span style=\"font-family: symbol;\">\u00b7<\/span><span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>&#8211;<strong>Verbose<\/strong>: This parameter ensures that any status or progress messages that are written by the resource implementation are displayed in the console. This is particularly helpful during development and debugging.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\"><span style=\"font-family: symbol;\">\u00b7<\/span><span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>&#8211;<strong>ComputerName<\/strong>: If this parameter is omitted, the Local Configuration Manager (LCM) will try to use all the files in the configuration folder. Because we specified <em>localhost<\/em> as the name of the MOF file, the configuration is applied to the local computer.<\/p>\n<p class=\"MsoListParagraph\" style=\"text-indent: -0.25in;\"><span style=\"font-family: symbol;\">\u00b7<\/span><span style=\"line-height: 106%; font-family: 'Times New Roman','serif'; font-size: 7pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span>&#8211;<strong>Path<\/strong>: Points to the path where the MOF file resides. In this case, it is in the current directory.<\/p>\n<h2><\/h2>\n<h2>The pull mode configuration steps<\/h2>\n<p class=\"MsoNormal\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/5277.image_thumb_4F6DE6FE.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/5277.image_thumb_4F6DE6FE.png\" alt=\"image\" width=\"581\" height=\"138\" border=\"0\" \/><\/a><\/p>\n<h2>Set up configuration<\/h2>\n<p class=\"MsoNormal\">The following sections describe how to set up the configuration.<\/p>\n<h3>Author configuration for a target node<\/h3>\n<p class=\"MsoNormal\">Authoring a configuration to work in pull mode is almost identical to the process of authoring a configuration for push. There are some special considerations, however, which we\u2019ll cover in this section of the post.<\/p>\n<p class=\"MsoNormal\">First, let\u2019s look at a simple configuration that we can use for pull mode.<\/p>\n<p class=\"MsoNormal\"><strong>SimpleConfigurationForPullSample.ps1<\/strong><\/p>\n<table class=\"MsoNormalTable\" style=\"border-collapse: collapse;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"border-width: 1pt 1pt medium; border-style: solid solid none; border-color: windowtext windowtext currentcolor; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"color: darkblue; font-family: 'Lucida Console'; font-size: 9pt;\">Configuration<\/span><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\"> <span style=\"color: blueviolet;\">SimpleConfigurationForPullSample<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">{ <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 Node <span style=\"color: darkred;\">1C707B86-EF8E-4C29-B7C1-34DA2190AE24 <\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 {\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Computer <span class=\"SpellE\"><span style=\"color: blueviolet;\">ManagedNode<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Ensure\u00a0\u00a0 <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;Present&#8221;<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Name\u00a0\u00a0\u00a0\u00a0 <span style=\"color: darkgray;\">=<\/span> <span style=\"color: orangered;\">\u201cDomainClient1\u201d<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span class=\"SpellE\">DomainName<\/span> <span style=\"color: darkgray;\">=<\/span> <span style=\"color: orangered;\">\u201c<span class=\"SpellE\">TestDomain<\/span>\u201d<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0\u00a0\u00a0 }<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">}<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt; border-style: none solid; border-color: currentcolor windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">\u00a0<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentcolor windowtext windowtext; padding: 0in 5.4pt; width: 467.5pt;\" valign=\"top\" width=\"623\">\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"color: blueviolet; font-family: 'Lucida Console'; font-size: 9pt;\">SimpleConfigurationForPullSample<\/span><span style=\"color: navy; font-family: 'Lucida Console'; font-size: 9pt;\">-output<\/span><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\"> <span style=\"color: darkred;\">&#8220;.&#8221;<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">There is not much difference in the way that configurations are constructed for pull scenarios. The main difference to note in this simple example is the node name, which is a GUID. This is because we provide a configuration ID that matches this GUID when we are performing the pull from the pull server.<\/p>\n<h3>Designate configuration to target machine<\/h3>\n<p class=\"MsoNormal\">To define the configuration above, we must have a GUID value that we can use in the node definition. To generate a new GUID, refer to <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms241442(v=vs.80).aspx\">Create GUID (guidgen.exe)<\/a> or <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.guid.newguid.aspx\"><span class=\"SpellE\">Guid.NewGuid<\/span> Method<\/a>.<\/p>\n<p class=\"MsoNormal\">Using unique identifiers for configurations ensures that the mapping between the pull server and its pull clients is unambiguous, and each receives its own configuration.<\/p>\n<h3>Generate configuration MOF<\/h3>\n<p class=\"MsoNormal\">Once the configuration script is complete, the next step is to run the script to generate a new &lt;<em>yournewguid<\/em>&gt;.mof. Once you run the script is, there is a new folder with the name of the configuration containing the MOF file. It is always good practice to ensure that the contents of the new MOF file match the contents of the configuration before moving forward.<\/p>\n<h3>Generate MOF file checksum<\/h3>\n<p class=\"MsoNormal\">A checksum file is required before deploying the configuration to the pull server. This allows the LCM to validate the configuration before applying it. To generate a new checksum for the configuration, we need to run the <strong>New-DSCCheckSum<\/strong> command as follows.<\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">PS D:\\Samples&gt; New-DSCCheckSum &#8211;<span class=\"SpellE\">ConfigurationPath<\/span> .\\SimpleConfigurationForPullSample &#8211;<span class=\"SpellE\">OutPath<\/span> .\\SimpleConfigurationForPullSample -Verbose -Force<\/span><\/p>\n<p class=\"MsoNormal\" style=\"background: white; line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: 'Lucida Console'; font-size: 9pt;\">VERBOSE: Create checksum file &#8216;D:\\Samples\\SimpleConfigurationForPullSample\\1C707B86-EF8E-4C29-B7C1-34DA2190AE24.mof.checksum&#8217; <\/span><\/p>\n<p class=\"MsoNormal\">When the .ps1 script was generated, it was generated under the folder <strong>SimpleConfigurationForPullSample<\/strong>, which is created and named after the configuration. The new MOF file is placed in that directory, so in the call to <strong>New-DSCCheckSum<\/strong>, we must provide the configuration path. It is recommended to use the output path to have the new checksum file stored in the same place as the MOF file. Later, during the preparation of the pull server, we must copy both of these files to a specific location on the pull server.<\/p>\n<h2>Set up the pull server<\/h2>\n<p>For configuring a machine as a pull server from which the pull clients will get their respective configurations, please refer to <a href=\"http:\/\/blogs.msdn.com\/b\/powershell\/archive\/2013\/11\/21\/powershell-dsc-resource-for-configuring-pull-server-environment.aspx\">\u201cDSC Resource for configuring pull server environment\u201d blog<\/a>\u00a0.<\/p>\n<h3>Deploy MOF and checksum files to the pull server<\/h3>\n<p>In order to provision the pull server with configuration files, we need to:<\/p>\n<ul>\n<li>Run script that generates node configuration Mofs<\/li>\n<li>Use New-DSCChecksum cmdlet to generate checksum files<\/li>\n<li>Copy all mofs and associated checksum files to pull server<\/li>\n<\/ul>\n<p>The MOF files containing the configurations of the nodes must be stored on the pull server in the following location <strong>$env:SystemDrive\\Program Files\\WindowsPowershell\\DscService\\Configuration<\/strong>.<\/p>\n<h3>Configure the target node for pull mode<\/h3>\n<p>Each node (pull client) must be able to contact the pull server. This is accomplished via the use of a meta-configuration file that runs on the node. Here is an example of a meta-configuration script that we will use to change LCM setting of the node to be in pull mode as well as configure pull server URL that the node will be downloading its configurations from.<\/p>\n<p>&nbsp;<\/p>\n<table class=\"MsoNormalTable\" style=\"border-collapse: collapse;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 863.6pt; border: solid windowtext 1.0pt; border-bottom: none; padding: 0in 5.4pt 0in 5.4pt;\" valign=\"top\" width=\"1151\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console'; color: darkblue;\">Configuration<\/span><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\"> <span style=\"color: blueviolet;\">SimpleMetaConfigurationForPull<\/span> <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">{ <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0 <span style=\"color: darkblue;\">LocalConfigurationManager<\/span> <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0 { <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ConfigurationID <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;1C707B86-EF8E-4C29-B7C1-34DA2190AE24&#8221;<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RefreshMode <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;PULL&#8221;<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DownloadManagerName <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;WebDownloadManager&#8221;<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RebootNodeIfNeeded <span style=\"color: darkgray;\">=<\/span> <span style=\"color: orangered;\">$true<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RefreshFrequencyMins <span style=\"color: darkgray;\">=<\/span> <span style=\"color: purple;\">30<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ConfigurationModeFrequencyMins <span style=\"color: darkgray;\">=<\/span> <span style=\"color: purple;\">60<\/span>; <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ConfigurationMode <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">&#8220;ApplyAndAutoCorrect&#8221;<\/span>;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DownloadManagerCustomData <span style=\"color: darkgray;\">=<\/span> @{ServerUrl <span style=\"color: darkgray;\">=<\/span>\u00a0\u00a0\u00a0 <span style=\"color: darkred;\">&#8220;http:\/\/PullServer:8080\/PSDSCPullServer\/PSDSCPullServer.svc&#8221;<\/span>; AllowUnsecureConnection <span style=\"color: darkgray;\">=<\/span> <span style=\"color: darkred;\">\u201cTRUE\u201d<\/span>}<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0\u00a0\u00a0\u00a0 } <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">}\u00a0 <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\">\u00a0<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: normal; background: white;\"><span style=\"font-size: 9.0pt; font-family: 'Lucida Console'; color: blue;\">SimpleMetaConfigurationForPull<\/span><span style=\"font-size: 9.0pt; font-family: 'Lucida Console';\"> <span style=\"color: navy;\">-Output<\/span> <span style=\"color: darkred;\">&#8220;.&#8221; <\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 863.6pt; border: solid windowtext 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;\" valign=\"top\" width=\"1151\">\n<p class=\"MsoNormal\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Once the script runs, a meta-configuration mof file will be created in SimpleMetaConfigurationForPull folder.<\/p>\n<p>For providing LCM with contact information about the pull server, we will use <strong>DownloadManagerCustomData<\/strong> key\/value pair property of the meta-configuration. As seen above, there are two distinct key\/value pairs that are used to configure the node.<\/p>\n<ul>\n<li><strong>ServerUrl<\/strong>. This value must point to the URL of the DSC pull service on the pull server machine.<\/li>\n<li><strong>AllowUnsecureConnection<\/strong>. Note that we are using HTTP port 8080 to access the service, and in this simple example, we are using an unsecured connection, so we set the value to \u201cTrue\u201d.<\/li>\n<\/ul>\n<p>We must set the <strong>ConfigurationID<\/strong> property of LCM. This is the value of the new GUID that was used to create the configuration file that the node will be downloading (in this example it is the GUID of <strong>SimpleConfigurationForPullSample.ps1).<\/strong> To change LCM default from push to be in pull, we must change the <strong>RefreshMode<\/strong> property of LCM to be \u201c<strong>PULL<\/strong>\u201d.<\/p>\n<h2>Set up DSC on target node<\/h2>\n<h3>Setting LCM on pull clients<\/h3>\n<p>In the \u201cConfigure target node for pull mode\u201d section of this post, we saw how a configuration can be modeled to set the configuration of the Local Configuration Manager. To configure the LCM, we need to run the Set-DscLocalConfigurationManager command on each of the pull clients. The example meta-configuration file addresses one client, because it has a unique configuration identifier which differentiates it from other configurations intended for other clients.<\/p>\n<p>To run Set-DscLocalConfigurationManager, we provide the following parameters.<\/p>\n<p>&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>ComputerName<\/strong>: In this case, the value of the ComputerName parameter is <strong>localhost<\/strong>, because we are configuring the local node.<\/p>\n<p class=\"MsoNormal\">&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>Path<\/strong>: The path to the location where the localhost.meta.mof file resides. If the -Verbose switch is used on invocation, we can see the following output on a successful execution of Set-DscLocalConfigurationManager.<\/p>\n<p class=\"MsoNormal\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/4135.image_thumb_23BD1D02.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/30\/2018\/10\/4135.image_thumb_23BD1D02.png\" alt=\"image\" width=\"761\" height=\"278\" border=\"0\" \/><\/a><\/p>\n<p class=\"MsoNormal\">Once all the pull clients are configured, each node can download its configuration from the pull server. From this point on, the DSC consistency engine ensures that the desired state is retained over time until it is explicitly changed by the user. Each node\u2019s configuration will be updated with the configuration defined in its mof file that was deployed with the checksum file on the pull server.<\/p>\n<h2>Conclusion<\/h2>\n<p class=\"MsoNormal\">In this blog post, we have seen how we can use DSC to configure machines locally and remotely, and have looked at the two modes of deployment, <em>push<\/em> and <em>pull<\/em>. In this series of blogs, we plan to cover custom resources, security, and other important aspects of the DSC platform.<\/p>\n<p>Louis Castaneda[MSFT]<\/p>\n<p>Narine Mossikyan<\/p>\n<p><em>PowerShell Team<\/em><\/p>\n<p><em>[Updated 5\/29\/14]\n<\/em><\/p>\n<div>\n<div class=\"MsoNormal\" style=\"margin-bottom: 0pt;\">\n<hr align=\"left\" size=\"1\" width=\"33%\" \/>\n<\/div>\n<\/div>\n<\/div>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Components.PostAttachments\/00\/10\/47\/17\/30\/PushPullModeSample.zip\">PushPullModeSample.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ bw + bsl &amp;&amp; x + aw &#8211; ah \/ 2 &#8211; cw &gt;= bsl ) { c.style.left = x + aw &#8211; ah \/ 2 &#8211; cw; } else { c.style.left = x + ah \/ 2; } if (y + ch + ah \/ 2 &gt; bh + bst &amp;&amp; y + [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[142,150,248,251,345,348],"class_list":["post-1951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-desired-state-configuration","tag-dsc","tag-powershell","tag-powershell-4-0","tag-windows-powershell-4-0","tag-windows-powershell-desired-state-configuration"],"acf":[],"blog_post_summary":"<p>\/\/ bw + bsl &amp;&amp; x + aw &#8211; ah \/ 2 &#8211; cw &gt;= bsl ) { c.style.left = x + aw &#8211; ah \/ 2 &#8211; cw; } else { c.style.left = x + ah \/ 2; } if (y + ch + ah \/ 2 &gt; bh + bst &amp;&amp; y + [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=1951"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1951\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=1951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=1951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=1951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}