<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Shalabh’s blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/shalabhp/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/shalabhp/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:34:56 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to Use HTA file to provide a Computer Name and OU name in OSD</title>
      <link>https://docs.microsoft.com/archive/blogs/shalabhp/how-to-use-hta-file-to-provide-a-computer-name-and-ou-name-in-osd</link>
      <pubDate>Tue, 17 Nov 2015 16:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Shalabh Pradhan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/shalabhp/2015/11/17/how-to-use-hta-file-to-provide-a-computer-name-and-ou-name-in-osd/</guid>
      <description><![CDATA[Hi Folks,
One of the most common requirements at the time of OSD is to have the option to specify a...]]></description>
      <content:encoded><![CDATA[<p>Hi Folks,</p>
<p>One of the most common requirements at the time of OSD is to have the option to specify a custom machine name during the deployment.<br />There are multiple ways to accomplish this. I am demonstrating the approach of using a simple HTA file to achieve this.Before we discuss about the steps required for this objective, let us discuss briefly about HTA files and setting up task sequence variables:</p>
<p><strong><span style="font-size:large;">HTA Files:</span></strong></p>
<p>HTML Applications (HTAs) provide a way to wrap your scripts up in a graphical user interface. For more information on scripting HTA files please refer to following links:</p>
<p><a href="https://technet.microsoft.com/en-us/library/ee692662.aspx">https://technet.microsoft.com/en-us/library/ee692662.aspx</a><br /><a href="https://technet.microsoft.com/en-us/library/ee692768.aspx?f=255&amp;MSPPError=-2147217396">https://technet.microsoft.com/en-us/library/ee692768.aspx?f=255&amp;MSPPError=-2147217396</a></p>
<p><strong><span style="font-size:large;"></span></strong>&nbsp;<strong><span style="font-size:large;">Task Sequence Variables:</span></strong></p>
<p>We can create, get, and set task sequence variables in a running task sequence by using the task sequence environment COM automation object (Microsoft.SMS.TSEnvironment). In the example below I have used this object to set the OSDComputerName and OSDDomainOUName variables:</p>
<div id="codeSnippetWrapper" style="overflow:auto;cursor:text;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:97.5%;direction:ltr;text-align:left;margin:20px 0px 10px;line-height:12pt;background-color:#f4f4f4;border:silver 1px solid;padding:4px;">
<div id="codeSnippet" style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;line-height:12pt;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:white;border-style:none;padding:0px;"><span id="lnum1" style="color:#606060;">   1:</span> <span style="color:#0000ff;">SET</span> env = CreateObject(<span style="color:#006080;">&quot;Microsoft.SMS.TSEnvironment&quot;</span>) </pre>
<!--CRLF-->
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:#f4f4f4;border-style:none;padding:0px;"><span id="lnum2" style="color:#606060;">   2:</span> env(<span style="color:#006080;">&quot;OSDComputerName&quot;</span>) = OSDcomputername.Value </pre>
<!--CRLF-->
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:white;border-style:none;padding:0px;"><span id="lnum3" style="color:#606060;">   3:</span> env(<span style="color:#006080;">&quot;OSDDomainOUName&quot;</span>) = computerOUName.Value </pre>
<!--CRLF--></div>
</div>
<p>This can also be set using powershell:</p>
<div id="codeSnippetWrapper" style="overflow:auto;cursor:text;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:97.5%;direction:ltr;text-align:left;margin:20px 0px 10px;line-height:12pt;background-color:#f4f4f4;border:silver 1px solid;padding:4px;">
<div id="codeSnippet" style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;line-height:12pt;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:white;border-style:none;padding:0px;"><span id="lnum1" style="color:#606060;">   1:</span> $OSDEnv = <span style="color:#0000ff;">New</span>-<span style="color:#0000ff;">Object</span> -COMObject Microsoft.SMS.TSEnvironment</pre>
<!--CRLF-->
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:#f4f4f4;border-style:none;padding:0px;"><span id="lnum2" style="color:#606060;">   2:</span> $OSDENV.Value(<span style="color:#006080;">&quot;OSDComputerName&quot;</span>)</pre>
<!--CRLF-->
<pre style="overflow:visible;font-size:8pt;font-family:&#39;Courier New&#39;, courier, monospace;width:100%;color:black;direction:ltr;text-align:left;margin:0em;line-height:12pt;background-color:white;border-style:none;padding:0px;"><span id="lnum3" style="color:#606060;">   3:</span> $OSDENV.Value(<span style="color:#006080;">&quot;OSDDomainOUName&quot;</span>)</pre>
<!--CRLF--></div>
</div>
<p>Please refer to following article to know more about Task Sequence Variables in a Running Configuration Manager Task Sequence:</p>
<p><a title="https://msdn.microsoft.com/en-us/library/cc145669.aspx" href="https://msdn.microsoft.com/en-us/library/cc145669.aspx">https://msdn.microsoft.com/en-us/library/cc145669.aspx</a>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><span style="font-size:large;">Using HTA file to provide Computer Name during task sequence:</span></strong></p>
<p>I have used a simple task sequence in this example where I have left the Domain OU name blank(for the next example where I provide the option to enter an OU name as well). I am not using any custom unattend.xml file:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/clip_image002_11A8DA97.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/clip_5F00_image002_5F00_11A8DA97.jpg"><img title="clip_image002" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border:0px;" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/clip_image002_thumb_3EC05816.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/clip_5F00_image002_5F00_thumb_5F00_3EC05816.jpg" width="503" height="455" /></a></p>
<p>&nbsp; 1.) Create a package with the HTA file:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_4EAF5605.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_4EAF5605.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_6024D83F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_6024D83F.png" width="444" height="449" /></a></p>
<p>&nbsp;</p>
<p>2.) Modify the boot image to include this package and add a prestart command to it:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_6EF19EC8.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_6EF19EC8.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_7774FE12.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_7774FE12.png" width="444" height="465" /></a></p>
<p>To know more about using Prestart command please refer to following article:</p>
<p><a title="https://blogs.msdn.com/b/steverac/archive/2015/04/22/power-belongs-to-you-the-osd-prestart-command.aspx" href="https://blogs.msdn.com/b/steverac/archive/2015/04/22/power-belongs-to-you-the-osd-prestart-command.aspx">https://blogs.msdn.com/b/steverac/archive/2015/04/22/power-belongs-to-you-the-osd-prestart-command.aspx</a></p>
<p>3.) Enable HTA support in boot image. This can be done by going to the Optional components tab and then clicking on the yellow start on the lower right had corner to bring up the complete list:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_04716ED5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_04716ED5.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_08121A63.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_08121A63.png" width="444" height="457" /></a></p>
<p>In case you wish to enable powershell support, please choose that as well</p>
<p>4.) Confirm these settings (click apply and ok), re-distribute the&nbsp; boot image to DP</p>
<p>5.)&nbsp; Boot up a new machine (I used boot media during my test, however we can use PXE boot as well)</p>
<p>6.)&nbsp; Click Next to start the task sequence wizard:</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_53081BE3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_53081BE3.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_77300723.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_77300723.png" width="469" height="403" /></a></p>
<p>7.) This will execute the prestart command and bring up the HTA file:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_62411561.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_62411561.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_6B30A7A0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_6B30A7A0.png" width="479" height="428" /></a></p>
<p>8.) Select the task sequence:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_4150336B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_4150336B.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_0CB267E1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_0CB267E1.png" width="483" height="474" /></a></p>
<p>9.) We can see that the HTA file execution was completed successfully:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_34E4A0F3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_34E4A0F3.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_56666133.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_56666133.png" width="494" height="410" /></a></p>
<p>10.) We see that the Task Sequence writes the data to unattend.xml file, this consists of the Task Sequence variable we set as part of HTA file in the beginning:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_4347C538.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_4347C538.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_7E3188B2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_7E3188B2.png" width="517" height="391" /></a></p>
<p>11.) We can open the Unattend.xml in WINPE and verify the name has been set:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_1ACE0486.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_1ACE0486.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_21176BC5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_21176BC5.png" width="522" height="355" /></a></p>
<p>12.) The machine will reboot and after sometime get into full OS. We can verify from the netsetup.log that at the time of install the value specified was picked up for machine name:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_2BD753CB.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_2BD753CB.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border-width:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_4CECE116.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_4CECE116.png" width="532" height="332" /></a></p>
<p>&nbsp;</p>
<p><strong><span style="font-size:large;">Using HTA file to provide Computer Name and OU Name during task sequence:</span></strong></p>
<p>Same steps can be performed to provide with an OU name as well during the install process. Complete Distinguished Name of the OU needs to be provided for this to work:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_526FD25B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_526FD25B.png"><img title="image" style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/image_thumb_4F600517.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/image_5F00_thumb_5F00_4F600517.png" width="541" height="438" /></a></p>
<p>At the time of OSD this value is appended to the default unattend.xml file:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/clip_image0025_57E36461.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/clip_5F00_image0025_5F00_57E36461.jpg"><img style="background-image:none;padding-top:0px;padding-left:0px;display:inline;padding-right:0px;border:0px;" border="0" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/metablogapi/clip_image0025_thumb_4DB45AA5.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68-metablogapi/clip_5F00_image0025_5F00_thumb_5F00_4DB45AA5.jpg" width="533" height="394" alt=" " /></a></p>
<p>&nbsp;</p>
<p>Similarly we have a list of task sequence variables which can be set during the Install Process. Please refer to following TechNet article for the list of variables:</p>
<p><a title="https://technet.microsoft.com/en-au/library/hh273365.aspx" href="https://technet.microsoft.com/en-au/library/hh273365.aspx">https://technet.microsoft.com/en-au/library/hh273365.aspx</a></p>
<p>&nbsp;</p>
<p>Hope this helps!</p>
<p></p>
<p><strong><em>Disclaimer: This posting is provided &quot;AS IS&quot; with no warranties and confers no rights</em></strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/10168/00/00/03/65/71/75/OUName.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-10168-00-00-03-65-71-75/OUName.zip">OUName.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Support Tip: ConfigMgr 2012 Backup fails with error- Unable to Connect to Registry</title>
      <link>https://docs.microsoft.com/archive/blogs/shalabhp/support-tip-configmgr-2012-backup-fails-with-error-unable-to-connect-to-registry</link>
      <pubDate>Fri, 07 Aug 2015 17:33:36 GMT</pubDate>
      <dc:creator><![CDATA[Shalabh Pradhan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/shalabhp/2015/08/07/support-tip-configmgr-2012-backup-fails-with-error-unable-to-connect-to-registry/</guid>
      <description><![CDATA[Hi Folks,

I recently worked on an issue with backup on ConfigMgr 2012 R2 where the backup...]]></description>
      <content:encoded><![CDATA[<p><span>Hi Folks,</span></p>
<p></p>
<p>I recently worked on an issue with backup on ConfigMgr 2012 R2 where the backup continuously failed when it was trying to make a connection to a registry key using UNC path. We observed that&nbsp;the SMS VSS Writer is missing from the output of &#39;vssadmin list writers&#39;.</p>
<p></p>
<p>We get following entries in the log files:</p>
<p><strong><span style="font-family:Tahoma;font-size:small;"><span style="text-decoration:underline;">SMSBAckup.log:</span></span></strong></p>
<p><span style="font-family:Tahoma;font-size:small;"><em><strong>Error: GatherWriterMetadata failed</strong>. SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br />STATMSG: ID=5046 SEV=E LEV=M SOURCE=&quot;SMS Server&quot; COMP=&quot;SMS_SITE_BACKUP&quot; SYS=Primary1.sccm2012.local SITE=PR1 PID=3420 TID=4688 GMTDATE=Thu Mar 12 22:14:44.117 2015 ISTR0=&quot;&quot; ISTR1=&quot;&quot; ISTR2=&quot;&quot; ISTR3=&quot;&quot; ISTR4=&quot;&quot; ISTR5=&quot;&quot; ISTR6=&quot;&quot; ISTR7=&quot;&quot; ISTR8=&quot;&quot; ISTR9=&quot;&quot; NUMATTRS=0 SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br />SMS_SITE_BACKUP failed. Please see previous errors. SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br />STATMSG: ID=5060 SEV=E LEV=M SOURCE=&quot;SMS Server&quot; COMP=&quot;SMS_SITE_BACKUP&quot; SYS=Primary1.sccm2012.local SITE=PR1 PID=3420 TID=4688&nbsp;GMTDATE=Thu Mar 12 22:14:44.133 2015<strong> ISTR0=&quot;Error: GatherWriterMetadata failed</strong>.&quot; ISTR1=&quot;&quot; ISTR2=&quot;&quot; ISTR3=&quot;&quot; ISTR4=&quot;&quot; ISTR5=&quot;&quot; ISTR6=&quot;&quot; ISTR7=&quot;&quot; ISTR8=&quot;&quot; ISTR9=&quot;&quot; NUMATTRS=0 SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br />SMS_SITE_BACKUP service is stopping. SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br />STATMSG: ID=502 SEV=I LEV=M SOURCE=&quot;SMS Server&quot; COMP=&quot;SMS_SITE_BACKUP&quot; SYS=Primary1.sccm2012.local SITE=PR1 PID=3420 TID=4688 GMTDATE=Thu Mar 12 22:14:44.133 2015 ISTR0=&quot;SMS_SITE_BACKUP&quot; ISTR1=&quot;&quot; ISTR2=&quot;&quot; ISTR3=&quot;&quot; ISTR4=&quot;&quot; ISTR5=&quot;&quot; ISTR6=&quot;&quot; ISTR7=&quot;&quot; ISTR8=&quot;&quot; ISTR9=&quot;&quot; NUMATTRS=0 SMS_SITE_BACKUP 3/13/2015 3:44:44 AM 4688 (0x1250)<br /><strong>Raised&nbsp;<span id="#h3">backup</span>&nbsp;task failure alert. SMS_SITE_BACKUP</strong> 3/13/2015 3:44:44 AM 4688 (0x1250)</em></span>&nbsp;</p>
<p><span style="font-family:Tahoma;font-size:small;"><span style="text-decoration:underline;">&nbsp;</span></span></p>
<p><strong><span style="font-family:Tahoma;font-size:small;"><span style="text-decoration:underline;">SMSWriter.log:</span></span></strong></p>
<p><span style="font-family:Tahoma;font-size:small;"><em>Successfully included C:\Program Files\Microsoft Configuration Manager\install.map into to the metadata. SMS_SITE_VSS_WRITER 3/13/2015 3:44:33 AM 5540 (0x15A4)<br /></em><em><strong>Unable to connect to registry containing \\PRIMARY1.SCCM2012.LOCAL\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS (Error=&nbsp; - [error code: 53, error message: The network path was not found.]). SMS_SITE_VSS_WRITER 3/13/2015 3:44:33 AM 5540 (0x15A4)<br />Error: Failed to inlcude \\PRIMARY1.SCCM2012.LOCAL\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS - C:\Program Files\Microsoft Configuration Manager\BackupTemp\SMSbkSiteRegSMS.dat into the metadata. SMS_SITE_VSS_WRITER 3/13/2015 3:44:33 AM 5540 (0x15A4)<br /></strong>STATMSG: ID=6820 SEV=E LEV=M SOURCE=&quot;SMS Server&quot; COMP=&quot;SMS_SITE_VSS_WRITER&quot; SYS=Primary1.sccm2012.local SITE=PR1 PID=4228 TID=5540 GMTDATE=Thu Mar 12 22:14:33.409 2015 ISTR0=&quot;\\PRIMARY1.SCCM2012.LOCAL\HKEY_LOCAL_MACHINE\Software\Microsoft\SMS&quot; ISTR1=&quot;C:\Program Files\Microsoft Configuration Manager\BackupTemp\SMSbkSiteRegSMS.dat&quot; ISTR2=&quot;&quot; ISTR3=&quot;&quot; ISTR4=&quot;&quot; ISTR5=&quot;&quot; ISTR6=&quot;&quot; ISTR7=&quot;&quot; ISTR8=&quot;&quot; ISTR9=&quot;&quot; NUMATTRS=0 SMS_SITE_VSS_WRITER 3/13/2015 3:44:33 AM 5540 (0x15A4)<br /><strong>Building meta data failed. SMS_SITE_VSS_WRITER&nbsp;</strong>3/13/2015 3:44:33 AM 5540 (0x15A4)</em></span></p>
<p><span style="font-family:Tahoma;font-size:small;"><em>&nbsp;</em></span></p>
<p></p>
<p>After doing a review of the process in background, we found out that&nbsp;a call is made to&nbsp;a&nbsp;windows function to make the connection to registry:</p>
<p></p>
<p><span style="font-family:Tahoma;font-size:small;"><strong>RegConnectRegistry function</strong></span></p>
<p></p>
<p><span style="font-family:Tahoma;font-size:small;">As per MSDN article:&nbsp;<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724840%28v=vs.85%29.aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms724840%28v=vs.85%29.aspx</a>:</span></p>
<p></p>
<p><em>&#39;<span style="font-family:Tahoma;font-size:small;">&quot;RegConnectRegistry requires the Remote Registry service to be running on the remote computer. By default, this service is configured to be started manually. To configure the Remote Registry service to start automatically, run Services.msc and change the Startup Type of the service to Automatic.&quot;</span></em></p>
<p></p>
<p>So the &#39;Remote Registry Service&#39; should be enabled.</p>
<p>We checked and determined the service was disabled. After Starting the &#39;<em><span>Remote Registry service&#39; backup was successful once again.</span></em></p>
<p><em><span>&nbsp;</span></em></p>
<p><em><span>Hope this helps.</span></em></p>
<p><span style="font-family:Tahoma;font-size:small;"><em>&nbsp;</em></span></p>]]></content:encoded>
    </item>
    <item>
      <title>OfflineServicing fails if you have 'NO_SMS_ON_DRIVE.SMS' on your ContentLib drive.</title>
      <link>https://docs.microsoft.com/archive/blogs/shalabhp/offlineservicing-fails-if-you-have-no_sms_on_drive-sms-on-your-contentlib-drive</link>
      <pubDate>Wed, 29 Jan 2014 16:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Shalabh Pradhan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/shalabhp/2014/01/29/offlineservicing-fails-if-you-have-no_sms_on_drive-sms-on-your-contentlib-drive/</guid>
      <description><![CDATA[Hi Folks,
&nbsp;
I recently came across an issue with offline servicing in ConfigMgr2012. The...]]></description>
      <content:encoded><![CDATA[<p>Hi Folks,</p>
<p>&nbsp;</p>
<p>I recently came across an issue with offline servicing in ConfigMgr2012. The issue was a bit obscure initially but a logical approach cracked it soon.</p>
<p>&nbsp;</p>
<p>Offline Servicing fails with following error -</p>
<p>&nbsp;</p>
<div>
<p><b>OfflineServicingMgr.log</b></p>
<p><b><br /></b>____________________________________________________________________</p>
</div>
<p><i>Mounting image at index 1. Image file=&#39;C:\ConfigMgr_OfflineImageServicing\TCM0012B\Win7SP1_Office10_NET40_x64_10_02_2012.wim&#39;, MountDirectory=&#39;C:\ConfigMgr_OfflineImageServicing\TCM0012B\ImageMountDir&#39;, ImageFileType=&#39;WIM&#39;, Mode=&#39;ReadWrite&#39;SMS_OFFLINE_SERVICING_MANAGER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 29/11/2013 10:44:20 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)Image OS information : MajorVersionMS = 6, MinorVersionMS = 1, MajorVersionLS = 7601, MinorVersionLS = 18015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SMS_OFFLINE_SERVICING_MANAGER&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)SQL&gt;&gt;&gt;set quoted_identifier on;set ansi_warnings on;set ansi_padding on;set ansi_nulls on;set concat_null_yields_null on;set arithabort on;set numeric_roundabort off;set DATEFORMAT mdy;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SMS_OFFLINE_SERVICING_MANAGER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)SQL&gt;&gt;&gt;&gt;&gt; Done.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SMS_OFFLINE_SERVICING_MANAGER&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)SQL&gt;&gt;&gt;<span style="background-color:#ffff00;">select distinct cpkg.Content_ID, ContentSubFolder, FileName from vCIAllContents cont join CI_ContentFiles cf on cf.Content_ID=cont.Content_ID join CI_ContentPackages cpkg on cpkg.Content_ID=cont.Content_ID join SMSPackages pkg on pkg.PkgID=cpkg.PkgID where CI_ID=16791696</span> SMS_OFFLINE_SERVICING_MANAGER&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)SQL&gt;&gt;&gt;&gt;&gt; Done.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SMS_OFFLINE_SERVICING_MANAGER&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)</i></p>
<div>
<p><span style="background-color:#ffff00;"><i>Failed to find properties of file 2</i></span><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SMS_OFFLINE_SERVICING_MANAGER&nbsp; 29/11/2013 10:47:23 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18772 (0x4954)</i></p>
</div>
<p>____________________________________________________________________</p>
<p>Interesting thing was that the number&nbsp; &ldquo;2&rdquo; kept changing every time we tried to run the wizard for offline servicing.</p>
<p>&nbsp;On running the SQL query in SQl management Studio We got:</p>
<p>____________________________________________________________________</p>
<div>
<p><b>select distinct cpkg.Content_ID, ContentSubFolder, FileName from vCIAllContents cont join CI_ContentFiles cf on cf.Content_ID=cont.Content_ID join CI_ContentPackages cpkg on cpkg.Content_ID=cont.Content_ID join SMSPackages pkg on pkg.PkgID=cpkg.PkgID where CI_ID=16791696</b></p>
<p>____________________________________________________________________</p>
</div>
<p><b>Result:</b></p>
<p><b>Content ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ContentSubFolder&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filename</b></p>
<p>16791021 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="background-color:#ffff00;">2921051e-5897-4120-b749-0f38f3ea6ac9</span> &nbsp; &nbsp; &nbsp; &nbsp;windows6.1-kb982666-x64.cab</p>
<p>&nbsp;</p>
<p>It turned out that the number &ldquo;2&rdquo; was the first character for the string &ldquo;<span style="background-color:#ffff00;">2921051e-5897-4120-b749-0f38f3ea6ac9</span>&rdquo;. This would change on subsequent attempts and the number &ldquo;2&rdquo; would be replaced by the first alphabet/digit of the value under &lsquo;ContentSubFolder&rsquo;.</p>
<p>This Number&nbsp; &lsquo;2921051e-5897-4120-b749-0f38f3ea6ac9&rsquo; was actually the name of the folder in the &lsquo;DataLib&rsquo; directory in &lsquo;SMSContentLib&rsquo;.</p>
<p>&nbsp;</p>
<p>I:\SCCMContentLib\DataLib\<span style="background-color:#ffff00;">2921051e-5897-4120-b749-0f38f3ea6ac9</span></p>
<p>&nbsp;</p>
<div>
<p>Opening the INI file we got following value&#39;s inside it:</p>
<p>____________________________________________________________________</p>
</div>
<p>[File]</p>
<p>Attributes=00000020</p>
<p>Size=63945</p>
<p>TimeModified=129385629639903558</p>
<div>
<p>Hash=<span style="background-color:#ffff00;">0DCA</span>7A2935011E00ACE4B5C1E3A3AF51095B2FDC91449504265C3667934119DB</p>
</div>
<p>&nbsp;____________________________________________________________________</p>
<p>The FileLib Directory was split across multiple drives. We found that the actual content for this Update was stored on E:\.</p>
<p>E:\SCCMContentLib\FileLib\<span style="background-color:#ffff00;">0DCA</span></p>
<p>&nbsp;</p>
<p>For more information on how to navigate inside SCCMContentLib please refer to:</p>
<p><a href="/b/configmgrdogs/archive/2012/04/16/configmgr-2012-content-library-overview.aspx">https://blogs.technet.com/b/configmgrdogs/archive/2012/04/16/configmgr-2012-content-library-overview.aspx</a></p>
<p>&nbsp;&nbsp;</p>
<p>Thus we knew that the content was very much present, but, was not reachable from OfflineServicing thread. At this point I decided to use procmon&nbsp; for the entire process. I found out that the E:\ Directory was not even being scanned&nbsp; in this process:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68/1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/1.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68/1.png" border="0" alt=" " width="688" height="56" /></a></p>
<p>&nbsp;</p>
<p>Looking at the registry value &#39;HKLM\Software\Microsoft\SMS\DP\ContentLibUsableDrives&#39;&nbsp; &#39;E:\&#39; was not added over there.</p>
<p>On further investigation we found out that &lsquo;<strong>NO_SMS_ON_DRIVE.SMS</strong>&rsquo; was present on &lsquo;E:\&rsquo;.This would make the smsexec process skip the drive when looking for content.&nbsp; We removed the &lsquo;NO_SMS_ON_DRIVE.SMS&rsquo; from &lsquo;E:\&rsquo; and restarted the &lsquo;smsexec&rsquo; service. After this&nbsp; we got &lsquo;E:\&rsquo; listed as a usable drive in registry:</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68/2.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/01/68/2.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-01-68/2.png" border="0" alt=" " /></a></p>
<p>&nbsp;</p>
<p>We ran the wizard for Offline servicing again and this time it completed successfully.</p>
<p>&nbsp;Hope This Helps!</p>
<p>&nbsp;</p>
<p><span style="color:#ff6600;"><strong>Shalabh Pradhan</strong></span></p>
<p><strong>Support Engineer | ConfigMgr Microsoft</strong></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>