<?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>The Deployment Guys</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/deploymentguys/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/deploymentguys/feed.xml</link>
    <description>Helping to deploy your world automagically...</description>
    <lastBuildDate>Mon, 25 Feb 2019 15:38:13 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Deploying legacy Windows with Configuration Manager 1702 and Windows ADK 1703</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/deploying-legacy-windows-with-configuration-manager-1702-and-windows-adk-1703</link>
      <pubDate>Sat, 03 Jun 2017 16:26:15 GMT</pubDate>
      <dc:creator><![CDATA[David Hornbaker]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/?p=4235</guid>
      <description><![CDATA[I built some machines to test upgrading from legacy Windows (7 &amp; 8.1) to Windows 10 CB 1073.  I...]]></description>
      <content:encoded><![CDATA[I built some machines to test upgrading from legacy Windows (7 &amp; 8.1) to Windows 10 CB 1073.  I created a standard UDI task sequence that could install Windows 7, 8.1 or 10 and built my first Windows 8.1 system.  Instead of the normal windows setup screen after reboot, this occurred:

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/Recovery.png"><img width="522" height="392" class="wp-image-4245 aligncenter" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/Recovery-300x225.png" /></a>

The disk appeared to be locked, but should not been locked since BitLocker pre-provision does not set up protectors.  When I rebooted to Windows PE, the disk was unlocked.  Next, I mounted the disk in Server 2016, it was unlocked, and everything looked just fine.  I needed to get some testing done, I disabled the BitLocker step, and built out my test machines. This was fine for initial testing, but I needed to test with BitLocker enabled.

The problem was the default encryption type that Windows PE 1703 uses. It is not supported in legacy operation systems.

BitLocker has several encryption types it can use:
<table width="903">
<tbody>
<tr>
<td width="156">Encryption Type</td>
<td width="156">Registry setting</td>
<td width="312">Notes</td>
</tr>
<tr>
<td width="156">AES 128 with Diffuser</td>
<td width="156">1</td>
<td width="312">Default Windows 7, Deprecated in Windows 8</td>
</tr>
<tr>
<td width="156">AES 256 with Diffuser</td>
<td width="156">2</td>
<td width="312">Deprecated in Windows 8</td>
</tr>
<tr>
<td width="156">AES 128</td>
<td width="156">3</td>
<td width="312">Default Window 8</td>
</tr>
<tr>
<td width="156">AES 256</td>
<td width="156">4</td>
<td width="312"></td>
</tr>
<tr>
<td width="156">XTS-AES 128</td>
<td width="156">5</td>
<td width="312">Default Windows 10, introduced in Windows 10</td>
</tr>
<tr>
<td width="156">XTS-AES 256</td>
<td width="156">6</td>
<td width="312"></td>
</tr>
</tbody>
</table>
Note: Specifying 1 or 2 will use AES without diffuser in Windows 8 and Windows 10.

The default encryption type can be changed by setting HKLM\Software\Policies\Microsoft\FVE\EncryptionMethod before the Pre-Provision step in the task sequence.  The step below sets the encryption type to AES 256.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/TS.png"><img width="379" height="322" class=" wp-image-4255 aligncenter" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/TS-300x255.png" /></a>

The modified task sequence completed and the systems were encrypted with AES 256 encryption.

<em>This post was contributed by <strong>David Hornbaker,</strong> a Senior Consultant with Microsoft Services.  </em>

<strong>Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/info/cpyright.mspx">Terms of Use</a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Security implications of upgrading to Windows 10</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/security-implications-of-upgrading-to-windows-10</link>
      <pubDate>Mon, 01 Aug 2016 23:27:50 GMT</pubDate>
      <dc:creator><![CDATA[David Hornbaker]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/?p=4215</guid>
      <description><![CDATA[Windows 10 has new security features that protect the system from malicious code being inserted in...]]></description>
      <content:encoded><![CDATA[Windows 10 has new security features that protect the system from malicious code being inserted in to the system startup process. The foundation of these security features are UEFI and Secure Boot. UEFI requires a new disk format and device firmware changes. These requirements effect the choices and configuration options when migrating from Windows 7 to Windows 10.
<h4><a></a>Unified Extensible Firmware Interface</h4>
Unified Extensible Firmware Interface (UEFI) controls the boot process of the PC. UEFI can operate in one of two modes: UEFI mode or BIOS-Compatibility mode. When operating in UEFI mode, UEFI verifies the signature of the Operating System bootloader to ensure that no malware (rootkits) have been introduced. When in BIOS-Compatibility mode, UEFI allows operating systems to boot in the same manner as they did under the older BIOS system.

Windows 8/8.1 and Windows 10 logo compliant systems, that shipped with Windows 8/8.1 or Windows 10, will have UEFI configured in UEFI mode. Systems that shipped with Windows 7 are configured to use UEFI in BIOS-Compatibility mode.

UEFI mode requires a different disk format then BIOS. UEFI mode requires disks use the GUID partition Table(GPT) as opposed to the older Master Boot Record(MBR) used in BIOS based systems.

For more information on UEFI see <a href="https://windows.microsoft.com/en-US/windows-8/what-uefi">https://windows.microsoft.com/en-US/windows-8/what-uefi</a>
<h4><a></a>Windows 10 Features that require UEFI</h4>
<h4><a></a>Device Integrity</h4>
<h4><a></a>Secure Boot</h4>
Secure Boot is a feature of UEFI that insures a personal computer will only boot software that is trusted by the manufacturer. When the PC starts, the firmware checks the signature of each component of boot software: this includes firmware drivers (option ROMS) and the operating system boot loader. If the drivers or boot loader are not signed with a certificate that is in the UEFI firmware database, the system will not boot.

For more information, see <a href="https://technet.microsoft.com/en-us/library/hh824987.aspx">https://technet.microsoft.com/en-us/library/hh824987.aspx</a>.
<h4><a></a>Early Launch Anti-Malware</h4>
Early Launch Anti-Malware provides a Microsoft-supported mechanism for anti-malware software to start before any third party boot drivers. This allows the anti-malware software to control the loading of boot drivers and not allow any unknown or infected boot driver to load.

For more information, see <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn265157(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/hardware/dn265157(v=vs.85).aspx</a>
<h4><a></a>Measured Boot</h4>
The Measured Boot feature provides anti-malware software with a trusted (resistant to spoofing and tampering) log of all boot components that started before anti-malware software. Anti-malware software can use the log to determine whether components that ran before it are trustworthy versus infected with malware. The anti-malware software on the local machine sends the log to a remote server for evaluation. The remote server initiates remediation actions either by interacting with software on the client, or through out-of-band mechanisms as appropriate. The remote server is necessary because the software running on the local client is not trustworthy if malicious components, that executed before the anti-malware software, tamper with the anti-malware software. This feature has a dependency on a Trusted Platform Module (TPM) 1.2 being enabled on the system.

For more information, see <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn653311(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/hardware/dn653311(v=vs.85).aspx</a>

<a href="https://msdnshared.blob.core.windows.net/media/2016/08/clip_image0021.png"><img width="244" height="150" title="clip_image002" style="padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/2016/08/clip_image002_thumb1.png" border="0" /></a>

Figure 1: Measured Boot and Early Start Anti-Malware
<h4>Virtualization Based Security</h4>
<h4><a></a>Device Guard</h4>
Device Guard is a combination of enterprise-related hardware and software security features, that when configured together, will lock down a device, so that it can only run trusted applications. If the application is not trusted it cannot run period.

Device Guard uses the new virtualization-based security in Windows 10 Enterprise to isolate the Code Integrity service from the Microsoft Windows kernel itself, letting the service use signatures, defined by your enterprise-controlled policy, to help determine what is trustworthy. In effect, the Code Integrity service runs alongside the kernel in a Windows hypervisor-protected container.

For more information, see <a href="https://technet.microsoft.com/en-us/itpro/windows/keep-secure/introduction-to-device-guard-virtualization-based-security-and-code-integrity-policies/">https://technet.microsoft.com/en-us/itpro/windows/keep-secure/introduction-to-device-guard-virtualization-based-security-and-code-integrity-policies </a>

Credential Guard

Introduced in Windows 10 Enterprise, Credential Guard uses virtualization-based security to isolate secrets so that only privileged system software can access them. Unauthorized access to these secrets can lead to credential theft attacks, such as Pass-the-Hash or Pass-The-Ticket.

For more information, see <a href="https://technet.microsoft.com/en-us/library/mt483740%28v=vs.85%29.aspx">https://technet.microsoft.com/en-us/library/mt483740%28v=vs.85%29.aspx</a>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="250" valign="top">Category</td>
<td width="250" valign="top">Feature</td>
<td width="250" valign="top">Requires UEFI</td>
<td width="250" valign="top">Requires TPM</td>
</tr>
<tr>
<td width="250" valign="top">Device Integrity</td>
<td width="250" valign="top">Secure Boot</td>
<td width="250" valign="top">Yes</td>
<td width="250" valign="top">No</td>
</tr>
<tr>
<td width="250" valign="top">Device Integrity</td>
<td width="250" valign="top">Early Launch Anti-Malware</td>
<td width="250" valign="top">Yes</td>
<td width="250" valign="top">No</td>
</tr>
<tr>
<td width="250" valign="top">Device Integrity</td>
<td width="250" valign="top">Measured Boot</td>
<td width="250" valign="top">Yes</td>
<td width="250" valign="top">Yes</td>
</tr>
<tr>
<td width="250" valign="top">Virtual Secure Mode</td>
<td width="250" valign="top">Device Guard</td>
<td width="250" valign="top">Yes</td>
<td width="250" valign="top">Yes</td>
</tr>
<tr>
<td width="250" valign="top">Virtual Secure Mode</td>
<td width="250" valign="top">Credential Guard</td>
<td width="250" valign="top">Yes</td>
<td width="250" valign="top">Yes</td>
</tr>
</tbody>
</table>
<h4><a></a>Migrating from Windows 7</h4>
UEFI was available in the Windows 7 timeframe. However, Windows 7 systems typically used UEFI in BIOS-Compatibility mode and MBR disks. This means, that to migrate a Windows 7 system to Windows 10 and take advantage of the new security features, the disk must be repartitioned using the GPT format. The system firmware will also have to be configured to use UEFI mode. Depending on PC vendor, it may be possible to automate the firmware configuration during the ConfigMgr OS deployment task sequence. Repartitioning, during an OS deployment task sequence, requires the system to be on a LAN and that sufficient space is available on a ConfigMgr State Migration Point in order to back up any data on the system. It is possible to detect if a system is on a LAN with sufficient storage, to do the repartition and firmware reconfiguration, or just upgrade, without repartition or firmware reconfiguration, if the system is remote.

<em>This post was contributed by <b>David Hornbaker,</b> a Senior Consultant with Microsoft Services.  </em>

<strong>Disclaimer: The information on this site is provided “AS IS” with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/info/cpyright.mspx"><span style="color: #337ab7;">Terms of Use</span></a>]]></content:encoded>
    </item>
    <item>
      <title>Windows 10 Start Layout Customization</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/windows-10-start-layout-customization</link>
      <pubDate>Mon, 07 Mar 2016 12:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Mark.Hooks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2016/03/07/windows-10-start-layout-customization/</guid>
      <description><![CDATA[This Windows&nbsp;10 Start Layout Customization guide provides detailed guidance on how...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Segoe UI;font-size:small;">This </span><i><span style="font-family:Segoe UI;font-size:small;">Windows&nbsp;10 Start Layout Customization guide</span></i><span style="font-family:Segoe UI;font-size:small;"> provides detailed guidance on how organizations can customize the Windows 10 Start layout. Organizations often desire to deploy a customized Start layout on their devices to help direct users to specific applications.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/1.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/1.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;1. Default Windows 10 Start Layout</span></i></p>
<p><span style="font-family:Segoe UI;font-size:small;">In previous editions of Windows (Windows 10 RTM and Windows 8.1) it was possible to create customized Start layouts for an organization. However, there were only two options available to control these start layout customizations:</span></p>
<ul>
<li><span style="font-size:small;"></span><b><span style="font-family:Segoe UI;font-size:small;">Locked Down Start Layout</span></b><span style="font-family:Segoe UI;font-size:small;"> &ndash; The start layout was customized to meet an organizations requirement but it was entirely locked down and could not be customized by users</span></li>
<li><b><span style="font-family:Segoe UI;font-size:small;">Customizable Start Layout</span></b><span style="font-family:Segoe UI;font-size:small;"> &ndash; The start layout was customized to meet an organizations requirement but there was nothing to prevent the user from removing all of the organizations customizations, &nbsp;</span></li>
</ul>
<p><span style="font-family:Segoe UI;font-size:small;">Windows 10 version 1511 has introduced a new feature which makes it possible for an organization to customize the start layout by locking down individual groups within the Start layout. This allows an organization to customize their start layout and ensure that their corporate applications are always present on Start while allowing the end user the freedom to customize the start layout with their own applications.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<h3><span style="color:#0072c6;font-size:medium;">In this topic:</span></h3>
<ul>
<li><span style="font-size:small;"><a href="#Exporting">Exporting a Start layout</a></span></li>
<li><span style="font-size:small;"><a href="#Applying">Applying a Start layout</a></span></li>
<li><span style="font-size:small;"><a href="#Updating">Updating a Start layout</a></span></li>
<li><span style="font-size:small;"><a href="#Partial">Partially locking down groups in the Start Layout</a></span></li>
</ul>
<p></p>
<p>&nbsp;</p>
<h2><span style="color:#0072c6;font-size:x-large;"><a id="Exporting"></a>Exporting a Start layout</span></h2>
<p><span style="font-family:Segoe UI;font-size:small;">The simplest way to create customized Start layouts to apply to an organization is to manually create a sample layout on a test machine and then export that layout. The exported Start layout can then be deployed to all machines in the organization. To prepare a Start layout for export, you simply customize the Start layout on a test computer.</span></p>
<h3><span style="color:#0072c6;font-size:medium;">Prepare a test computer</span></h3>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;"></span><span style="font-family:Segoe UI;font-size:small;">Set up a test computer on which to customize the Start screen. Your test computer should have the either Windows 10 Enterprise or Windows 10 Education. Install all the applications and services that the Start screen should display. </span></li>
<li><span style="font-family:Segoe UI;font-size:small;"></span><span style="font-family:Segoe UI;font-size:small;">Create a new user account that you will use to customize the Start screen layout.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;"></span><span style="font-family:Segoe UI;font-size:small;">Sign in to your test computer with the user account that you created.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;"></span><span style="font-family:Segoe UI;font-size:small;">Customize the Start screen as you want users to see it by using the following techniques: </span></li>
</ol>
<h3><span style="color:#0072c6;font-size:medium;">Customize the Start Layout</span></h3>
<ul>
<li><span style="font-size:small;"></span><b><span style="font-family:Segoe UI;font-size:small;">Pin apps to the Start screen</span></b><span style="font-family:Segoe UI;font-size:small;">. From the Start screen, type the name of the app. When the app appears in the search results, right-click the app, and then click Pin to Start.</span></li>
</ul>
<p><span style="font-family:Segoe UI;font-size:small;">To view all apps, click All apps in the bottom-left corner of the Start screen. Right-click any app, and pin or unpin it from the Start screen. </span></p>
<ul>
<li><span style="font-size:small;"></span><b><span style="font-family:Segoe UI;font-size:small;">Unpin apps </span></b><span style="font-family:Segoe UI;font-size:small;">that you don&rsquo;t want to display. To unpin an app, right-click the app, and then click Unpin from Start.</span></li>
<li><span style="font-size:small;"></span><b><span style="font-family:Segoe UI;font-size:small;">Drag tiles</span></b><span style="font-family:Segoe UI;font-size:small;"> on the Start screen to reorder or group apps.</span></li>
<li><b><span style="font-family:Segoe UI;font-size:small;">Resize tiles</span></b><span style="font-family:Segoe UI;font-size:small;">. To resize tiles, right-click the tile and then click Resize.</span></li>
<li><b><span style="font-family:Segoe UI;font-size:small;">Create your own app groups</span></b><span style="font-family:Segoe UI;font-size:small;">. Drag the apps to an empty area. To name a group, click above the group of tiles and then type the name in the Name group field that appears above the group.</span></li>
</ul>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/2.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/2.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;2. Customized Windows 10 Start Layout</span></i></p>
<h3><span style="color:#0072c6;font-size:medium;">Export the Start Layout</span></h3>
<p><span style="font-family:Segoe UI;font-size:small;">When you have the Start screen layout that you want your users to see, use the </span><b><span style="font-family:Segoe UI;font-size:small;">Export-StartLayout</span></b><span style="font-family:Segoe UI;font-size:small;"> cmdlet in Windows PowerShell to export the Start screen to an .xml file.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;"></span><span style="font-family:Segoe UI;font-size:small;">From </span><b><span style="font-family:Segoe UI;font-size:small;">Start</span></b><span style="font-family:Segoe UI;font-size:small;">, open </span><b><span style="font-family:Segoe UI;font-size:small;">Windows PowerShell</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">At the </span><b><span style="font-family:Segoe UI;font-size:small;">Windows PowerShell</span></b><span style="font-family:Segoe UI;font-size:small;"> command prompt, enter the following command:</span></li>
</ol>
<p><span style="color:#0072c6;font-family:Lucida Console;font-size:small;">Export-StartLayout &ndash;path &lt;path&gt;&lt;file name&gt;.xml </span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/3.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/3.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/3.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;3. Export-StartLayout cmdlet</span></i></p>
<p><span style="font-family:Segoe UI;font-size:small;">In the previous command, -path is a required parameter that specifies the path and file name for the export file. You can specify a local path or a UNC path (for example, \\FileServer01\StartLayouts\StartLayoutMarketing.xml). </span><span style="font-family:Segoe UI;font-size:small;">The file must be accessible on the local computer when a user signs in (the user must have Read-only access). If the file is not available, the Start screen layout is not deployed during that session, and the user can make changes to the Start screen. </span></p>
<p><span style="font-family:Segoe UI;font-size:small;">If you plan to deploy a GPO that customizes Start screen layouts for domain users, store the .xml file in shared network storage that all of the users can access.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">Use a file name of your choice - for example, StartLayoutMarketing.xml. Include the .xml file name extension. The Export-StartLayout cmdlet does not append the file name extension, and the policy settings require the extension.</span></p>
<p>&nbsp;</p>
<h2><span style="color:#0072c6;font-size:x-large;"><a id="Applying"></a>Applying a Start layout</span></h2>
<p><span style="font-family:Segoe UI;font-size:small;">Once you have an exported Start Layout you can use the XML file to apply this start layout to your entire organization using PowerShell or Group Policy.</span></p>
<h3><span style="color:#0072c6;font-size:medium;">PowerShell</span></h3>
<p><span style="font-family:Segoe UI;font-size:small;">When you have the Start screen layout exported, use the </span><b><span style="font-family:Segoe UI;font-size:small;">Import-StartLayout</span></b><span style="font-family:Segoe UI;font-size:small;"> cmdlet in Windows PowerShell to manually import the .xml file into the system.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;">From </span><b><span style="font-family:Segoe UI;font-size:small;">Start</span></b><span style="font-family:Segoe UI;font-size:small;">, open </span><b><span style="font-family:Segoe UI;font-size:small;">Windows PowerShell</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">At the </span><b><span style="font-family:Segoe UI;font-size:small;">Windows PowerShell</span></b><span style="font-family:Segoe UI;font-size:small;"> command prompt, enter the following command:</span></li>
</ol>
<p><span style="color:#0072c6;font-family:Lucida Console;font-size:small;">Import-StartLayout &ndash;LayoutPath &lt;path&gt;&lt;file name&gt;.xml &ndash;MountPath %systemdrive%</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/4.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/4.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/4.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/4.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;4. Import-StartLayout cmdlet</span></i></p>
<p><b><span style="color:#0d0d0d;font-family:Segoe UI;">Important&nbsp; </span></b></p>
<p><span style="color:#0d0d0d;font-family:Segoe UI;">Applying a Start Layout through the Import-StartLayout cmdlet will not enforce the layout and users will have an option to perform changes. This will only apply to new user profiles created in the machine after applying the custom Start Layout.</span></p>
<h3><span style="color:#0072c6;font-size:medium;">Group Policy</span></h3>
<p><span style="font-family:Segoe UI;font-size:small;">To apply the Start layout to users in a domain, use the Group Policy Management Console (GPMC) to configure a domain-based Group Policy Object (GPO) that sets Start Layout policy settings in the Start Menu and Taskbar administrative template for users in a domain. </span></p>
<p><span style="font-family:Segoe UI;font-size:small;">The GPO applies the Start layout at the next user sign-in. Each time the user signs in, the timestamp of the .xml file with the Start layout is checked and if a newer version of the file is available, the settings in the latest version of the file are applied.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">The GPO can be configured from any computer on which the necessary ADMX and ADML files (StartMenu.admx and StartMenu.adml) for Windows 10 are installed.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">The .xml file with the Start layout must be located on shared network storage that is available to the users&rsquo; computers when they sign in and the users must have Read-only access to the file. If the file is not available at sign-in, the Start screen is not customized during the session, and the user can make changes to the Start screen.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;">On a </span><b><span style="font-family:Segoe UI;font-size:small;">Domain Controller</span></b><span style="font-family:Segoe UI;font-size:small;">, open the </span><b><span style="font-family:Segoe UI;font-size:small;">Group Policy Management Console</span></b><span style="font-family:Segoe UI;font-size:small;"> (gpmc.msc).</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">In the </span><b><span style="font-family:Segoe UI;font-size:small;">Group Policy Management Console</span></b><span style="font-family:Segoe UI;font-size:small;">, browse to Group Policy Management &gt; Forest: &lt;forest name&gt; &gt; Domains &gt; &lt;domain name&gt; &gt; </span><b><span style="font-family:Segoe UI;font-size:small;">Group Policy Objects</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Right-click on </span><b><span style="font-family:Segoe UI;font-size:small;">Group Policy Objects</span></b><span style="font-family:Segoe UI;font-size:small;"> and select </span><b><span style="font-family:Segoe UI;font-size:small;">New</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">In the </span><b><span style="font-family:Segoe UI;font-size:small;">New GPO</span></b><span style="font-family:Segoe UI;font-size:small;"> dialog box, provide a </span><b><span style="font-family:Segoe UI;font-size:small;">Name</span></b><span style="font-family:Segoe UI;font-size:small;"> then click </span><b><span style="font-family:Segoe UI;font-size:small;">OK</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Right-click on the GPO created from the previous step then select </span><b><span style="font-family:Segoe UI;font-size:small;">Edit</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Go to User Configuration or Computer Configuration &gt; Policies &gt; Administrative Templates &gt;</span><b><span style="font-family:Segoe UI;font-size:small;">Start Menu and Taskbar</span></b><span style="font-family:Segoe UI;font-size:small;">. </span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Right-click </span><b><span style="font-family:Segoe UI;font-size:small;">Start Layout</span></b><span style="font-family:Segoe UI;font-size:small;"> in the right pane, and click </span><b><span style="font-family:Segoe UI;font-size:small;">Edit</span></b><span style="font-family:Segoe UI;font-size:small;">. This opens the Start Layout policy settings.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Enter the following settings, and then click </span><b><span style="font-family:Segoe UI;font-size:small;">OK</span></b><span style="font-family:Segoe UI;font-size:small;">:</span><ol>
<li><span style="font-family:Segoe UI;font-size:small;">Select </span><b><span style="font-family:Segoe UI;font-size:small;">Enabled</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Under Options, specify the </span><b><span style="font-family:Segoe UI;font-size:small;">path</span></b><span style="font-family:Segoe UI;font-size:small;"> to the .xml file that contains the Start layout. For example, type C:\Users\Test01\StartScreen.xml or \\ShareName\StartScreen.xml.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Optionally, enter a comment to identify the Start layout.</span></li>
</ol></li>
</ol>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/5.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/5.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/5.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;5. Start Layout Group Policy Setting</span></i></p>
<p><b><span style="color:#0d0d0d;font-family:Segoe UI;">Important&nbsp; </span></b></p>
<p><span style="color:#0d0d0d;font-family:Segoe UI;">By default, applying Start Layout customizations via GPO will enforce the layout and prevent users from performing changes. To allow users to modify the Start Layout, go to the Partial Lockdown section.</span></p>
<h3><span style="color:#0072c6;font-size:medium;">Provisioning Packages</span></h3>
<p><span style="font-family:Segoe UI;font-size:small;">Use the Imaging and Configuration Designer (ICD) tool included in the Windows Assessment and Deployment Kit (ADK) for Windows 10 to create a provisioning package that applies a customized Start layout. Install the ADK.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;">Open </span><b><span style="font-family:Segoe UI;font-size:small;">ICD</span></b><span style="font-family:Segoe UI;font-size:small;"> (by default, %windir%\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\ICD.exe).</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Choose </span><b><span style="font-family:Segoe UI;font-size:small;">New provisioning package</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Name your project, and click </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Choose </span><b><span style="font-family:Segoe UI;font-size:small;">Common to all Windows editions</span></b><span style="font-family:Segoe UI;font-size:small;"> and click </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">On </span><b><span style="font-family:Segoe UI;font-size:small;">New project</span></b><span style="font-family:Segoe UI;font-size:small;">, click </span><b><span style="font-family:Segoe UI;font-size:small;">Finish</span></b><span style="font-family:Segoe UI;font-size:small;">. The workspace for your package opens.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Expand Runtime settings &gt; Start, and click </span><b><span style="font-family:Segoe UI;font-size:small;">StartLayout</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Specify the path and file name of the Start layout .xml that you created with the </span><b><span style="font-family:Segoe UI;font-size:small;">Export-StartLayout</span></b><span style="font-family:Segoe UI;font-size:small;"> cmdlet.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">On the </span><b><span style="font-family:Segoe UI;font-size:small;">File</span></b><span style="font-family:Segoe UI;font-size:small;"> menu, select </span><b><span style="font-family:Segoe UI;font-size:small;">Save</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">On the </span><b><span style="font-family:Segoe UI;font-size:small;">Export</span></b><span style="font-family:Segoe UI;font-size:small;"> menu, select </span><b><span style="font-family:Segoe UI;font-size:small;">Provisioning package</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">&nbsp;Change </span><b><span style="font-family:Segoe UI;font-size:small;">Owner</span></b><span style="font-family:Segoe UI;font-size:small;"> to </span><b><span style="font-family:Segoe UI;font-size:small;">IT Admin</span></b><span style="font-family:Segoe UI;font-size:small;">, which will set the precedence of this provisioning package higher than provisioning packages applied to this device from other sources, and then select </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">&nbsp;Optional. In the </span><b><span style="font-family:Segoe UI;font-size:small;">Provisioning package security</span></b><span style="font-family:Segoe UI;font-size:small;"> window, you can choose to encrypt the package and enable package signing.</span><ol>
<li><b><span style="font-family:Segoe UI;font-size:small;">Enable package encryption</span></b><span style="font-family:Segoe UI;font-size:small;"> - If you select this option, an auto-generated password will be shown on the screen.</span></li>
<li><b><span style="font-family:Segoe UI;font-size:small;">Enable package signing</span></b><span style="font-family:Segoe UI;font-size:small;"> - If you select this option, you must select a valid certificate to use for signing the package. You can specify the certificate by clicking Select... and choosing the certificate you want to use to sign the package.</span></li>
</ol></li>
<li><span style="font-family:Segoe UI;font-size:small;">Click </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;"> to specify the output location where you want the provisioning package to go when it&#39;s built. By default, Windows Imaging and Configuration Designer (ICD) uses the project folder as the output location.</span></li>
</ol><ol>
<li><span style="font-family:Segoe UI;font-size:small;">Optionally, you can click </span><b><span style="font-family:Segoe UI;font-size:small;">Browse</span></b><span style="font-family:Segoe UI;font-size:small;"> to change the default output location. </span></li>
</ol>
<ul>
<li><span style="font-family:Segoe UI;font-size:small;">Click </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Click </span><b><span style="font-family:Segoe UI;font-size:small;">Build</span></b><span style="font-family:Segoe UI;font-size:small;"> to start building the package. The provisioning package doesn&#39;t take long to build. The project information is displayed in the build page and the progress bar indicates the build status.&nbsp; </span><span style="font-family:Segoe UI;font-size:small;">If you need to cancel the build, click </span><b><span style="font-family:Segoe UI;font-size:small;">Cancel</span></b><span style="font-family:Segoe UI;font-size:small;">. This cancels the current build process, closes the wizard, and takes you back to the </span><b><span style="font-family:Segoe UI;font-size:small;">Customizations Page</span></b><span style="font-family:Segoe UI;font-size:small;">.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">If your build fails, an error message will show up that includes a link to the project folder. You can scan the logs to determine what caused the error. Once you fix the issue, try building the package again.</span></li>
</ul>
<p><span style="font-family:Segoe UI;font-size:small;">If your build is successful, the name of the provisioning package, output directory, and project directory will be shown. </span></p>
<ul>
<li><span style="font-family:Segoe UI;font-size:small;">If you choose, you can build the provisioning package again and pick a different path for the output package. To do this, click </span><b><span style="font-family:Segoe UI;font-size:small;">Back</span></b><span style="font-family:Segoe UI;font-size:small;"> to change the output package name and path, and then click </span><b><span style="font-family:Segoe UI;font-size:small;">Next</span></b><span style="font-family:Segoe UI;font-size:small;"> to start another build.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">If you are done, click </span><b><span style="font-family:Segoe UI;font-size:small;">Finish</span></b><span style="font-family:Segoe UI;font-size:small;"> to close the wizard and go back to the </span><b><span style="font-family:Segoe UI;font-size:small;">Customizations Page</span></b><span style="font-family:Segoe UI;font-size:small;">.</span><span style="font-family:Segoe UI;font-size:small;"><br /></span></li>
</ul>
<p style="margin-left:30px;"><span style="font-family:Segoe UI;font-size:small;">16.</span>&nbsp;&nbsp; <span style="font-family:Segoe UI;font-size:small;">Copy the provisioning package to the target device.</span></p>
<p style="margin-left:30px;"><span style="font-family:Segoe UI;font-size:small;">17.</span>&nbsp;&nbsp; <span style="font-family:Segoe UI;font-size:small;">Double-click the ppkg file and allow it to install.</span></p>
<p><b><span style="color:#0d0d0d;font-family:Segoe UI;">Important</span></b></p>
<p><span style="color:#0d0d0d;font-family:Segoe UI;">By default, applying Start Layout customizations via Provisioning Packages will enforce the layout and prevent users from performing changes. To allow users to modify the Start Layout, go to the Partial Lockdown section.</span></p>
<p><span style="color:#0d0d0d;font-family:Segoe UI;">&nbsp;</span></p>
<p><span style="color:#0d0d0d;font-family:Segoe UI;">&nbsp;</span></p>
<h2><span style="color:#0072c6;font-size:x-large;"><a id="Updating"></a><a id="Partial"></a>Updating a Start layout</span></h2>
<h3><span style="color:#0072c6;font-size:medium;">General</span></h3>
<p><span style="font-family:Segoe UI;font-size:small;">After you use Group Policy to apply a customized Start layout on a computer or in a domain, you can update the layout simply by replacing the .xml file that is specified in the Start Layout policy settings with a file with a newer timestamp.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;">Customize the Start screen on your test computer the way that you want it to look for users.</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Run the Export-StartLayout cmdlet, with the following format, to export the new Start screen layout to an .xml file that overwrites the original file:</span></li>
</ol>
<p><span style="color:#0072c6;font-family:Lucida Console;font-size:small;">Export-StartLayout &ndash;path &lt;path&gt;&lt;file name&gt;.xml</span></p>
<p><span style="color:#0072c6;font-family:Lucida Console;font-size:small;">&nbsp;</span></p>
<p><span style="color:#0072c6;font-family:Lucida Console;font-size:small;">&nbsp;</span></p>
<h2><span style="color:#0072c6;font-size:x-large;">Partial Lockdown</span></h2>
<p><span style="font-family:Segoe UI;font-size:small;">By default, applying a custom Start Layout via Group Policy enforces and locks down the Start Layout which prohibits users in making any modifications. For Enterprises that would like to provide users the ability to personalize or modify the Start Layout while only partially locking down certain groups they can update the custom Start Layout xml file to support this capability. This feature is only available in Windows 10 version&nbsp;1511.</span></p>
<ol>
<li><span style="font-family:Segoe UI;font-size:small;">Open the exported Start Layout .xml file</span></li>
<li><span style="font-family:Segoe UI;font-size:small;">Locate the &lt;DefaultLayoutOverride&gt; section and add a parameter as detailed below.</span></li>
</ol>
<p style="margin-left:60px;"><span style="font-family:Segoe UI;font-size:small;">&lt;DefaultLayoutOverride LayoutCustomizationRestrictionType=&rdquo;OnlySpecifiedGroups&rdquo;&gt;</span></p>
<p style="text-align:center;"><span style="font-family:Segoe UI;font-size:small;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/6.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/6.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/6.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/6.png" border="0" /></a><br /></span></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">&nbsp;Figure&nbsp;6. Partial Lockdown Parameter</span></i></p>
<p style="margin-left:30px;"><span style="font-family:Segoe UI;font-size:small;">3.&nbsp;&nbsp;Save the update Start Layout .xml file and apply via Group Policy or Provisioning Packages.</span><span style="font-family:Segoe UI;font-size:small;"><br /></span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/7.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/7.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27/7.png" border="0" /></a></p>
<p style="text-align:center;"><i><span style="color:#44546a;font-family:Segoe UI;">Figure&nbsp;7. Start Layout applied with Partial Lockdown setting</span></i></p>
<p><b><span>Important&nbsp; </span></b></p>
<p><span>Applying a Start Layout using the &quot;OnlySpecifiedGroups&quot; parameter using Group Policy or provisioning packs will only lock the groups&nbsp;specified in the Start Layout&nbsp;xml. file&nbsp;All other groups in the Start Layout can be controlled&nbsp;by the&nbsp;user.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<h2><span style="color:#0072c6;font-size:x-large;">Frequ</span><span style="color:#0072c6;font-size:x-large;">ently Asked Questions</span></h2>
<p><span style="font-family:Segoe UI;font-size:small;">Q) Is it possible to programmatically modify the start screen through an API.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">A) No. There is no API that allows programmatic access to the Start Layout. The Start Layout XML could be programmatically edited to automatically customize the Start Layout.</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<h2><span style="color:#0072c6;font-size:x-large;">Additional Resources</span></h2>
<ul>
<li><a href="https://technet.microsoft.com/en-us/library/dn283399(v=wps.630).aspx"><span style="color:#0563c1;font-family:Segoe UI;font-size:small;">TechNet - Start Screen Cmdlets in PowerShell</span></a></li>
<li><a href="https://technet.microsoft.com/en-us/library/mt592638(v=vs.85).aspx"><span style="color:#0563c1;font-family:Segoe UI;font-size:small;">TechNet - Customize and Export Start Layout</span></a></li>
<li><a href="https://technet.microsoft.com/en-us/library/mt431718(v=vs.85).aspx"><span style="color:#0563c1;font-family:Segoe UI;font-size:small;">TechNet - Customize Windows 10 Start with Group Policy</span></a><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span><span style="font-family:Segoe UI;font-size:small;"><br /></span></li>
</ul>
<p><span style="font-family:Segoe UI;font-size:small;">&nbsp;</span></p>
<p></p>
<p><b><span lang="EN">Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </span></b><span lang="EN"><a href="https://www.microsoft.com/about/legal/en/us/IntellectualProperty/Copyright/Default.aspx"><span>Terms of Use</span></a><b>.</b></span></p>
<p></p>
<p><i><span lang="EN">This post was contributed by <strong>Mark Hooks </strong>and <strong>Marvin Quinzon</strong><b>, </b>both&nbsp;architects within Microsoft Services.</span></i></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Script to Make ServiceUI.exe Easier to Use for OSD Custom User Interfaces</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/script-to-make-serviceui-exe-easier-to-use-for-osd-custom-user-interfaces</link>
      <pubDate>Mon, 06 Jul 2015 06:29:17 GMT</pubDate>
      <dc:creator><![CDATA[Michael Murgolo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/07/06/script-to-make-serviceui-exe-easier-to-use-for-osd-custom-user-interfaces/</guid>
      <description><![CDATA[Since Configuration Manager task sequences usually run as the System account, the task sequence...]]></description>
      <content:encoded><![CDATA[<p>Since Configuration Manager task sequences usually run as the System account, the task sequence cannot natively launch and display a user interface that will be visible on the screen.&nbsp; So MDT ships with an utility called <strong>ServiceUI.exe</strong> that allows executable to display on a different desktop than the System desktop (which is not visible).&nbsp; This executable is used by <strong>UDIWizard.wsf</strong> to display the UDI Wizard when needed.</p>
<p>I recently has a requirement for a UI that could not be met with the UDI Wizard.&nbsp; So I created custom HTML Applications (HTA) for this instead.&nbsp; You can find various articles on the web that describe using <strong>ServiceUI.exe</strong> with other user interfaces like HTML Applications like this one: <a title="https://blogs.technet.com/b/cameronk/archive/2011/01/25/can-i-use-serviceui-exe-to-launch-other-programs-besides-the-udi-setup-wizard.aspx" href="/b/cameronk/archive/2011/01/25/can-i-use-serviceui-exe-to-launch-other-programs-besides-the-udi-setup-wizard.aspx">https://blogs.technet.com/b/cameronk/archive/2011/01/25/can-i-use-serviceui-exe-to-launch-other-programs-besides-the-udi-setup-wizard.aspx</a>.&nbsp; But to use it correctly, you have to make sure to pick the correct process for ServiceUI to use to find the correct desktop on which it will display the custom UI.&nbsp; There are also other things that <strong>UDIWizard.wsf</strong> takes care of in its code, like dismissing the task sequence progress UI before displaying the custom UI.</p>
<p>So to get the benefits of using the code in <strong>UDIWizard.wsf</strong> with any other UI executable, I basically took the code from <strong>UDIWizard.wsf</strong>, removed all the UDI Wizard handling code, and add the bits to launch another executable.&nbsp; The new script, <strong>MDTRunWithServiceUI.wsf</strong>, should be added to the Scripts folder of the ConfigMgr MDT Toolkit package.&nbsp; It should be run with a Run Command Line step and has a command line syntax as show in this example:</p>
<blockquote>
<p><span style="font-family:Consolas;">cscript &quot;%DeployRoot%\Scripts\MDTRunWithServiceUI.wsf&quot; /UIExePath:&quot;%SystemRoot%\System32\mshta.exe&quot; /UIExeParam:&quot;%DeployRoot%\Scripts\MyHTA.hta&quot;</span></p>
</blockquote>
<p>where /UIExePath is the path of the executable to launch and /UIExeParam is the optional command line parameter to pass to the executable.&nbsp; (If you look at the script header you will notice an additional command line switch of /UIExeTitle.&nbsp; I some instances when launching our task sequence from Software Center, the HTA would pop up behind Software Center instead on top of it.&nbsp; The code run by this switch was my attempt to launch a VBScript on the same desktop to attempt to &ldquo;activate&rdquo; the window and make it topmost.&nbsp; As you can see from the notes in the header I have not be able to get this to work.&nbsp; If any of you do figure this out, post back a comment on how you did it).</p>
<p><strong>MDTRunWithServiceUI.wsf</strong> is provided below.</p>
<p>&nbsp;</p>
<p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/about/legal/en/us/IntellectualProperty/Copyright/Default.aspx">Terms of Use</a><strong></strong><strong>.</strong></p>
<p><em>This post was contributed by <strong>Michael Murgolo,</strong> a Senior Consultant with Microsoft Services - U.S. East Region.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/6127/00/00/03/65/17/75/MDTRunWithServiceUI.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6127-00-00-03-65-17-75/MDTRunWithServiceUI.zip">MDTRunWithServiceUI.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Dynamically Setting Variables as Over-writable during Gather</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/dynamically-setting-variables-as-over-writable-during-gather</link>
      <pubDate>Thu, 02 Jul 2015 13:33:15 GMT</pubDate>
      <dc:creator><![CDATA[Michael Murgolo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/07/02/dynamically-setting-variables-as-over-writable-during-gather/</guid>
      <description><![CDATA[During the MDT Gather process, almost all properties (variables) are treated as &ldquo;first writer...]]></description>
      <content:encoded><![CDATA[<p>During the MDT Gather process, almost all properties (variables) are treated as &ldquo;first writer wins&rdquo; (i.e. the value cannot be changed during Gather once it is set for the first time).&nbsp; <strong>ZTIGather.xml</strong> defines the &ldquo;known&rdquo; MDT variables for Gather.&nbsp; The ones that are able to be changed (overwritten) during Gather have the property <em>overwrite=&quot;true&quot;</em>.&nbsp; Any custom variable not defined in <strong>ZTIGather.xml</strong> is treated as having <em>overwrite=&quot;false&quot;</em>.</p>
<p>This behavior may not be desirable in all cases.&nbsp; For example, for one deployment I was setting a custom variable during Gather called <em>ComputerRecordExists</em> that would be True if an MDT database record existed for the computer and False if it did not.&nbsp; In this task sequence, if <em>ComputerRecordExists</em> was found to be False, then a stored procedure was run against the scheduling database.&nbsp; If the computer was scheduled for deployment, the procedure would kick off a server side process to create the database record.&nbsp; I then needed to run Gather a second time and reset <em>ComputerRecordExists</em> (and a few other variables) based on if a record now existed.&nbsp; However, by default the second Gather would not change the values because they had already been set.&nbsp; There are a few ways this could be handled with existing task sequence steps or configuration files but none were particularly elegant to me.</p>
<p>First, I could have added static Set Task Sequence Variable steps to clear the values of all the variables in questions.&nbsp; I wasn&rsquo;t happy with having to have step external to Gather for this.&nbsp; Second, variables can be added to <strong>ZTIGather.xml</strong> and variables in there can have their overwrite property changed.&nbsp; However, doing this creates a persistent change for that Deployment Share/Toolkit package.&nbsp; Also, changes to <strong>ZTIGather.xml</strong> may also be overwritten when upgrading versions of MDT.&nbsp; What I really wanted was just to have a directive in <strong>CustomSettings.ini</strong> that would make the specified variables over-writable for that run of Gather.</p>
<p>So I took a deep dive into <strong>ZTIGather.wsf</strong> and <strong>ZTIUtility.vbs</strong> and managed to accomplish just this.&nbsp; The route to getting there is kind of complicated.&nbsp; If you&rsquo;re not interested in the internals of these scripts and the code I used to do this, just jump down to the implementation section below.&nbsp; For those who are interested, here we go.</p>
<h5>Script Internals</h5>
<p>Starting with BDD 2007, the deployment scripts in MDT were written as VBScripts in the Windows Script File (WSF) format used by the Windows Script Host.&nbsp; The original ones (BDD 2007 &ndash; MDT 2008) used a main <em>ZTIProcess</em> function with the other supporting functions in global (or script) scope.&nbsp; (If you are not familiar with the concept of scope in VBScript, there is an overview here: <a title="https://msdn.microsoft.com/en-us/subscriptions/t7zd6etz(v=vs.84).aspx" href="https://msdn.microsoft.com/en-us/subscriptions/t7zd6etz(v=vs.84).aspx">https://msdn.microsoft.com/en-us/subscriptions/t7zd6etz(v=vs.84).aspx</a>.)</p>
<p>Starting with MDT 2010 the WSF scripts were changed to implement almost all the code in a VBScript Class. The Class name must match script file name. This was done to better facilitate unit testing. Because of this change, the procedures/variables in the scripts are no longer available in global scope.&nbsp; Why is not having the procedures/variables available in global scope an issue?&nbsp; Because you may want to do something like calling functions or access objects in the <strong>ZTIGather.wsf</strong> class in <strong>CustomSetting.ini</strong>and this will not work the way these script are written.</p>
<p>In the <strong>ZTIGather.wsf</strong> class, the list of properties for which overwrite=&quot;true&quot; are stored in a Dictionary object called <em>dicOverwrite</em>.&nbsp; Because this object is not available in the global scope we cannot simply add a line like <em>AddToOverwiteDic=#dicOverwrite.Add(&quot;ComputerRecordExists&quot;, &quot;&quot;)#</em> to <strong>CustomSettings.ini</strong>to add a property to the list</p>
<p>Fortunately, while digging though <strong>ZTIUtility.vbs</strong> I found the place where the MDT Team hooks in to run their unit test code.&nbsp; (You learn something new every day.)&nbsp; This can be leveraged to run custom script code to solve this problem.&nbsp; To understand this, I have to give you a little insight into what I found out about what happens when an MDT 2010-style WSF script is run. The first thing the script does is call <em>RunNewInstance</em>. This is a global function in <strong>ZTIUtility.vbs</strong>.&nbsp; <em>RunNewInstance</em> calls <em>oUtility.RunNewInstanceEx</em>. This function actually creates the instance of the script Class as the variable <em>oScriptClass</em> in the scope of this function.&nbsp; After that it looks to see if the /TestHook command line argument was specified.&nbsp; If it was, the VBScript file specified with the /TestHook argument is read and executed in the same local scope.&nbsp; Finally the <em>Main</em> function in the class is run in the same scope.&nbsp; Because this TestHook file is executed in the same scope as the <em>oScriptClass</em>object, the code in the TestHook file can then make it available in the global scope using these lines of VBScript:</p>
<blockquote>
<p><span style="font-family:Consolas;">ExecuteGlobal &quot;Dim oScriptClassGlobal&quot;<br />Set oScriptClassGlobal = oScriptClass</span></p>
</blockquote>
<p>These lines dimension the <em>oScriptClassGlobal</em> variable in the global scope and then set it equal to the <em>oScriptClass</em> object. Now <em>oScriptClassGlobal</em>can be used to access the properties and method in the script Class instance in the global scope.</p>
<p>The TestHook script that I created, <strong>MDTTestHookGatherOverwriteProperties.vbs</strong>, takes this a little further.&nbsp; When <em>RunNewInstanceEx</em> locally executes the script, the code above is run and a global variable called <em>bTestHookExecuteLocal</em> is set to True indicate that this first execution happened.&nbsp; Then the TestHook script reads the contents of itself and executes it in the global scope to make a function called <em>AddOverwriteProperties</em> available globally.&nbsp; The global variable <em>bTestHookExecuteLocal</em> is checked to make sure the second global execution does not redo the tasks that only needed to be done in the first local execution.&nbsp; The <em>AddOverwriteProperties</em> function is the function that will be used to dynamically make variables over-writable in <strong>CustomSettings.ini</strong>.</p>
<h5>Implementing the Solution</h5>
<p>Fortunately, implementing this is simpler than understanding how it works.&nbsp; First, add <strong>MDTTestHookGatherOverwriteProperties.vbs</strong> to Scripts folder in the LTI Deployment Share or ConfigMgr MDT Toolkit package.</p>
<p>Because of the way the TestHook works, you cannot use the MDT Gather task sequence step since this process requires passing the /TestHook argument on the ZTIGather.wsf command line.&nbsp; So for any Gather where you want to use this technique, you will need to use a Run Command Line step instead.&nbsp; The command line for this step should be</p>
<blockquote>
<p><span style="font-family:Consolas;">cscript &quot;%DeployRoot%\Scripts\ZTIGather.wsf&quot; /inifile:CustomSettings.ini /TestHook:&quot;%DeployRoot%\Scripts\MDTTestHookGatherOverwriteProperties.vbs&quot;</span></p>
</blockquote>
<p>You would then change CustomSettings.ini to add the highlighted items below:</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=<span style="background-color:#ffff00;">TestHookSubsection</span>, TestCustomProperty1, TestCustomProperty2, Default<br />Properties=<span style="background-color:#ffff00;">AddOverwriteProperties</span>, MyCustomProperty</span></p>
<p><span style="font-family:Consolas;background-color:#ffff00;">[TestHookSubsection]<br />Subsection=TestHookLoaded-#ConvertBooleanToString(oUtility.Arguments.Exists(&quot;TestHook&quot;))#</span></p>
<p><span style="font-family:Consolas;background-color:#ffff00;">[TestHookLoaded-True]<br />AddOverwriteProperties=#AddOverwriteProperties(&quot;MyCustomProperty&quot;)#</span></p>
<p><span style="font-family:Consolas;">[TestCustomProperty1]<br />MyCustomProperty=Foo</span></p>
<p><span style="font-family:Consolas;">[TestCustomProperty2]<br />MyCustomProperty=Bar</span></p>
<p><span style="font-family:Consolas;">[Default]<br />OSInstall=Y</span></p>
</blockquote>
<p>The <em>AddOverwriteProperties</em> function takes as a parameter a string that is a comma separated list of properties to be added to the list of properties that can be overwritten.&nbsp; This should work for standard and custom properties.&nbsp; Caution should be take when changing the behavior of standard MDT properties as the MDT scripts may not expect these to change.&nbsp; Test thoroughly before doing that.</p>
<p>Without using <strong>MDTTestHookGatherOverwriteProperties.vbs</strong> as the TestHook, the custom property <em>MyCustomProperty</em> in the example would retain the value of Foo even when the TestCustomProperty2 section is processed.&nbsp; With this TestHook script in place, the value will change to Bar when the TestCustomProperty2 section is processed.</p>
<p><strong>MDTTestHookGatherOverwriteProperties.vbs</strong>&nbsp; is provided below.</p>
<p>&nbsp;</p>
<p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/about/legal/en/us/IntellectualProperty/Copyright/Default.aspx">Terms of Use</a><strong></strong><strong>.</strong></p>
<p><em>This post was contributed by <strong>Michael Murgolo,</strong> a Senior Consultant with Microsoft Services - U.S. East Region.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/6127/00/00/03/65/16/85/MDTTestHookGatherOverwriteProperties.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6127-00-00-03-65-16-85/MDTTestHookGatherOverwriteProperties.zip">MDTTestHookGatherOverwriteProperties.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Writing Data to the MDT Database During Gather</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/writing-data-to-the-mdt-database-during-gather</link>
      <pubDate>Wed, 01 Jul 2015 08:55:25 GMT</pubDate>
      <dc:creator><![CDATA[Michael Murgolo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/07/01/writing-data-to-the-mdt-database-during-gather/</guid>
      <description><![CDATA[MDT allow you to query the MDT Database during a Gather step using database sections in...]]></description>
      <content:encoded><![CDATA[<p>MDT allow you to query the MDT Database during a Gather step using database sections in <strong>CustomSetting.ini</strong>.&nbsp; This is great for retrieving settings to drive the deployment.&nbsp; However, there are occasions where you may want to write information back to the database.&nbsp; MDT provides no built-in way to do this.&nbsp; Michael Niehaus provided a PowerShell module to manipulate the database on his blog (get it <a href="/b/mniehaus/archive/2009/05/15/manipulating-the-microsoft-deployment-toolkit-database-using-powershell.aspx" target="_blank">here</a>).&nbsp; However, this is really more for provisioning entries into the database before the deployment.&nbsp; It could be used during the task sequence but is much less convenient than something like a database section in <strong>CustomSettings.ini</strong>.&nbsp; You could create stored procedures in SQL to do this as well but this also isn&rsquo;t very convenient and creates a dependency have someone who can write and maintain T-SQL code.</p>
<p>I wanted something that would work like a database section in <strong>CustomSettings.ini</strong> but allow modifications of the database.&nbsp; So I took the code in <strong>ZTIDataAccess.vbs</strong> (the MDT script that actually does the work of the database queries for <strong>ZTIGather.wsf</strong>) and created a new script, <strong>MDTDataModify.vbs</strong>, that allows you to add sections to CustomSettings.ini that are very similar to the database query section but do database modify operations instead.</p>
<p>To use this script, the account used to access the database (MDT user account or ConfigMgr Network Access Account) must have at least db_datareader and db_datawriter on the MDT database.</p>
<p>Since this script contains a VBScript Class it must be loaded during in CustomSettings.ini using <strong>MDTExitInclude.vbs</strong> from this <a href="/b/deploymentguys/archive/2015/06/30/loading-scripts-that-have-vbscript-classes-or-that-don-t-have-a-userexit-function-as-user-exit-scripts-script-update.aspx" target="_blank">previous post</a>.</p>
<blockquote>
<p><span style="font-family:consolas;">[Settings]<br />Priority=IncludeExitScripts, Default<br />Properties=ExitScripts</span></p>
<span style="font-family:consolas;"></span>
<p><span style="font-family:consolas;">[IncludeExitScripts]<br />UserExit=MDTExitInclude.vbs<br />ExitScripts=#IncludeFiles(&quot;MDTDataModify.vbs&quot;)#</span></p>
</blockquote>
<p>This script allow 3 different types of table operations: Update, Insert, and Delete.&nbsp; Update allows you to modify an existing record.&nbsp; Insert allows you to add a new record.&nbsp; Delete allows you to delete a record.</p>
<p>The CustomSettings.ini sections that are used with <strong>MDTDataModify.vbs</strong> are very similar to the standard database query sections supported by <strong>ZTIGather.wsf</strong>.&nbsp; The following properties are used:</p>
<table class="MsoNormalTable" style="border:currentColor;margin-left:5.4pt;list-style-type:disc;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td width="114" valign="top" style="background:#d9d9d9;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;padding-right:5.4pt;border:windowtext 1pt solid;">
<p class="CellHeading"><span style="color:#000000;font-size:small;"><strong>Property</strong></span></p>
</td>
<td width="414" valign="top" style="border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;background:#d9d9d9;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellHeading"><span style="color:#000000;font-size:small;"><strong>Description</strong></span></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>SQLServer</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the name of the computer running SQL Server to use in the operation</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Instance</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the name of the SQL Server instance on the computer specified in the <span class="Bold"><strong>SQLServer</strong></span> property. If you are using:</span></p>
<ul>
<li>
<div class="CellBullet"><span style="color:#000000;"><span style="font-size:small;">SQL Server installed as the default instances, you can leave <span class="Bold"><strong>Instance</strong></span> blank</span></span></div>
</li>
<li>
<div class="CellBullet"><span style="color:#000000;"><span style="font-size:small;">SQL Server Express, type <span class="Bold"><strong>SQLExpress</strong></span> for the instance name</span></span></div>
</li>
</ul>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Database</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the name of the MDT DB in the SQL Server instance specified in the <span class="Bold"><strong>Instance</strong></span> property.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Netlib</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the network library to be used in connecting to the MDT DB specified in the <span class="Bold"><strong>Database</strong></span> property and can be either Named Pipes (<strong>DBNDPNTW</strong>) or TCP/IP Sockets (<strong>DBMSSOCN</strong></span><span style="color:#000000;font-size:small;">).</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p><span style="font-size:small;"><strong>SQLShare</strong></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies a network shared folder on the computer specified in the <span class="Bold"><strong>SQLServer</strong></span> property, which is used when performing user authentication using Windows Integrated Authentication with Named Pipes protocol.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Table</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the table or view to be used in the operation.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Statement</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the operation to be performed and can be <strong>Update</strong>, <strong>Insert</strong>, or <strong>Delete</strong>.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>Parameters</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the selection criteria for finding rows for the operation. Conceptually, this property is the <span class="Bold">WHERE</span> clause in an SQL <span class="Bold">SELECT</span> statement.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>ParameterCondition</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies the Boolean operation to be performed when you specify more than one selection criterion in the <span class="Bold"><strong>Parameters</strong></span> property. You can select either Boolean <span class="Bold"><strong>AND</strong></span> (the default) or <span class="Bold"><strong>OR</strong></span> operations. If you want to use a Boolean <span class="Bold"><strong>OR</strong></span> operation, you must specify <span class="Bold"><strong>ParameterCondition=OR</strong></span>.</span></p>
</td>
</tr>
<tr>
<td width="114" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:windowtext 1pt solid;padding-right:5.4pt;">
<p class="CellBody"><span class="Bold"><span style="color:#000000;font-size:small;"><strong>WriteParameters</strong></span></span></p>
</td>
<td width="414" valign="top" style="border-top:medium none;border-right:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding-bottom:0in;padding-top:0in;padding-left:5.4pt;border-left:medium none;padding-right:5.4pt;">
<p class="CellBody"><span style="color:#000000;font-size:small;">Specifies properties to write back to the table or view during an <strong>Update</strong> or <strong>Insert</strong> operation.</span></p>
</td>
</tr>
</tbody>
</table>
<p>All the properties except the new Statement and WriteParameters properties work the same way as standard MDT database query section.</p>
<p>These sections also support variable remapping as a described in this post: <a title="https://blogs.technet.com/b/deploymentguys/archive/2013/08/12/remapping-variables-in-mdt-database-queries.aspx" href="/b/deploymentguys/archive/2013/08/12/remapping-variables-in-mdt-database-queries.aspx">https://blogs.technet.com/b/deploymentguys/archive/2013/08/12/remapping-variables-in-mdt-database-queries.aspx</a>.</p>
<p>To have a database modify section run in <strong>CustomSetting.ini</strong>, you DO NOT add it to the Priority line directly.&nbsp; If you do <strong>ZTIGather.wsf</strong> would treat it as standard database query section.&nbsp; Instead, you need to use the <em>ModifySQL</em> function that is included in <strong>MDTDataModify.vbs</strong> to run the section.&nbsp; Here are a few examples.</p>
<h4>Database Update</h4>
<p>In this example, the computer name (<em>OSDComputerName</em>) is generated based on the string &ldquo;ws&rdquo; and the first 10 characters of the serial number.&nbsp; Since this name is generated during the deployment it would be nice to have this value written back to the computer record for reference later.&nbsp; The following sample <strong>CustomSettings.ini</strong> will update an existing computer record:</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=Common, IncludeExitScripts, RunDBChanges<br />Properties=ExitScripts(*), Type, ID, ComputerID, DBChanges(*), MDTSQLServer, MDTDatabase, MDTNetlib, MDTSQLShare</span></p>
<p><span style="font-family:Consolas;">[Common]<br />MDTSQLServer=SQLServer1<br />MDTDatabase=MDT<br />MDTNetlib=DBNMPNTW<br />MDTSQLShare=SQLShare$<br />OSDComputerName=ws#Right(&quot;%SerialNumber%&quot;, 10)#</span></p>
<p><span style="font-family:Consolas;">[IncludeExitScripts]<br />; Load all user exit scripts<br />UserExit=MDTExitInclude.vbs<br />ExitScripts001=#Include(&quot;MDTDataModify.vbs&quot;)#</span></p>
<p><span style="font-family:Consolas;">[RunDBChanges]<br />DBChanges001=#ModifySQL(&quot;UpdateCSettings&quot;)#</span></p>
<p><span style="font-family:Consolas;">[UpdateCSettings]<br />SQLServer=%MDTSQLServer%<br />Database=%MDTDatabase%<br />Netlib=%MDTNetlib%<br />SQLShare=%MDTSQLShare%<br />Table=ComputerSettings<br />Parameters=UUID, AssetTag, SerialNumber, MacAddress<br />ParameterCondition=OR<br />Statement=Update<br />WriteParameters=OSDComputerName</span></p>
</blockquote>
<h4>Database Insert</h4>
<p>In this example I show how you can create the record for a computer by simply running a <em>Gather</em> step will the following sample <strong>CustomSetting.ini</strong>.&nbsp; This is useful if you are unboxing a new computer and don&rsquo;t want to depend on manually entering a record in the database by hand (which can be error prone).&nbsp; For example, you could create MDT or ConfigMgr task sequence media with a two step task sequence (<em>Use Toolkit Package</em> and <em>Gather</em> steps only) and boot the new machine with this media.&nbsp; The following sample <strong>CustomSettings.ini</strong> will insert a new computer record by first creating the <em>ComputerIdentity</em> table entry with the hardware variable values and then creating the associated Settings table entry (<em>Type=C</em> and <em>ID</em> that matches the <em>ID</em> of the <em>ComputerIdentity</em> table entry).&nbsp; The <em>ModifySQL</em> function with return an <em>InsertID</em> value if it creates a record with an identity value.&nbsp; I remap this to <em>ComputerID</em> to use it as an input to the second Insert section, remapping it to the <em>ID</em> field in the table.</p>
<p>In this sample I add the record with <em>OSInstall</em> set to NO so that a deployment cannot happen until the rest of the values needed for the record are populated.</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=Common, IncludeExitScripts, RunDBChanges<br />Properties=ExitScripts(*), Type, ID, ComputerID, DBChanges(*), MDTSQLServer, MDTDatabase, MDTNetlib, MDTSQLShare</span></p>
<p><span style="font-family:Consolas;">[Common]<br />MDTSQLServer=SQLServer1<br />MDTDatabase=MDT<br />MDTNetlib=DBNMPNTW<br />MDTSQLShare=SQLShare$<br /></span><span style="font-family:Consolas;">OSInstall=NO<br />Type=C</span></p>
<p><span style="font-family:Consolas;">[IncludeExitScripts]<br />; Load all user exit scripts<br />UserExit=MDTExitInclude.vbs<br />ExitScripts001=#Include(&quot;MDTDataModify.vbs&quot;)#</span></p>
<p><span style="font-family:Consolas;">[RunDBChanges]<br /></span><span style="font-family:Consolas;">DBChanges001=#ModifySQL(&quot;InsertCIdentity&quot;)#<br />DBChanges002=#ModifySQL(&quot;InsertCSettings&quot;)#</span></p>
<p><span style="font-family:Consolas;">[InsertCIdentity]<br />SQLServer=%MDTSQLServer%<br />Database=%MDTDatabase%<br />Netlib=%MDTNetlib%<br />SQLShare=%MDTSQLShare%<br />Table=ComputerIdentity<br />Statement=Insert<br />WriteParameters=AssetTag, SerialNumber, MacAddress, UUID, Description<br />InsertID=ComputerID</span></p>
<p><span style="font-family:Consolas;">[InsertCSettings]<br />SQLServer=%MDTSQLServer%<br />Database=%MDTDatabase%<br />Netlib=%MDTNetlib%<br />SQLShare=%MDTSQLShare%<br />Table=Settings<br />Statement=Insert<br />WriteParameters=Type, ComputerID, OSInstall<br />ComputerID=ID</span></p>
</blockquote>
<h4>Database Delete</h4>
<p>In the final example I demonstrate how you can delete the computer record.&nbsp; If you want to delete the record at the end of a successful deployment (groom records that are no longer needed) you can add a Gather step at the end of the task sequence that uses this sample <strong>CustomSettings.ini</strong>:</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=Common, IncludeExitScripts, RunDBChanges<br />Properties=ExitScripts(*), Type, ID, ComputerID, DBChanges(*), MDTSQLServer, MDTDatabase, MDTNetlib, MDTSQLShare</span></p>
<p><span style="font-family:Consolas;">[Common]<br />MDTSQLServer=SQLServer1<br />MDTDatabase=MDT<br />MDTNetlib=DBNMPNTW<br />MDTSQLShare=SQLShare$</span></p>
<p><span style="font-family:Consolas;">[IncludeExitScripts]<br />; Load all user exit scripts<br />UserExit=MDTExitInclude.vbs<br />ExitScripts001=#Include(&quot;MDTDataModify.vbs&quot;)#</span></p>
<p><span style="font-family:Consolas;">[RunDBChanges]<br /></span><span style="font-family:Consolas;">DBChanges001=#ModifySQL(&quot;DeleteCSettings&quot;)#</span></p>
<p><span style="font-family:Consolas;">[DeleteCSettings]<br />SQLServer=%MDTSQLServer%<br />Database=%MDTDatabase%<br />Netlib=%MDTNetlib%<br />SQLShare=%MDTSQLShare%<br />Table=ComputerIdentity<br />Parameters=UUID, AssetTag, SerialNumber, MacAddress<br />ParameterCondition=OR<br />Statement=Delete</span></p>
</blockquote>
<p><strong>MDTDataModify.vbs</strong>&nbsp; is provided below.</p>
<p>&nbsp;</p>
<p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/about/legal/en/us/IntellectualProperty/Copyright/Default.aspx">Terms of Use</a><strong></strong><strong>.</strong></p>
<p><em>This post was contributed by <strong>Michael Murgolo,</strong> a Senior Consultant with Microsoft Services - U.S. East Region.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/6127/00/00/03/65/16/31/MDTDataModify.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6127-00-00-03-65-16-31/MDTDataModify.zip">MDTDataModify.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Loading Scripts that Have VBScript Classes or that Don’t Have a UserExit Function as User Exit Scripts – Script Update</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/loading-scripts-that-have-vbscript-classes-or-that-dont-have-a-userexit-function-as-user-exit-scripts-script-update</link>
      <pubDate>Tue, 30 Jun 2015 12:57:29 GMT</pubDate>
      <dc:creator><![CDATA[Michael Murgolo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/06/30/loading-scripts-that-have-vbscript-classes-or-that-dont-have-a-userexit-function-as-user-exit-scripts-script-update/</guid>
      <description><![CDATA[In a previous post I provided a script that allows loading scripts that have VBScript Classes or...]]></description>
      <content:encoded><![CDATA[<p>In a <a href="/b/deploymentguys/archive/2013/09/13/loading-user-exit-scripts-with-vbscript-classes.aspx" target="_blank">previous post</a> I provided a script that allows loading scripts that have VBScript Classes or that don&rsquo;t have a UserExit function in them as User Exit scripts in CustomSetting.ini.&nbsp; This script also allows you to load multiple User Exit scripts in a single CustomSetting.ini section as in this example:</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=IncludeExitScripts, Default<br />Properties=ExitScripts(*)</span></p>
<span style="font-family:Consolas;"></span>
<p><span style="font-family:Consolas;">[IncludeExitScripts]<br />UserExit=MDTExitInclude.vbs<br />ExitScripts001=#Include(&quot;MDTLibHelperClasses.vbs&quot;)#<br />ExitScripts002=#Include(&quot;ModelAliasExit.vbs&quot;)#<br />ExitScripts003=#Include(&quot;MDTConfigMgrFunctions.vbs&quot;)#</span></p>
</blockquote>
<p>I was recently using this again at another customer and had one of those &ldquo;duh&rdquo; moments.&nbsp; Why didn&rsquo;t I make the <strong>Include</strong> function just take a comma separated list of scripts instead of just one?&nbsp; Then you wouldn&rsquo;t need multiple lines to load multiple scripts.&nbsp; So I added a new function to <strong>MDTExitInclude.vbs</strong> called <strong>IncludeFiles</strong> that accepts a list of scripts.&nbsp; This function then calls <strong>Include</strong> once for each script in the list.&nbsp; (I did it this way to maintain compatibility with the old method shown above.)&nbsp; The section can then be simplified to this:</p>
<blockquote>
<p><span style="font-family:Consolas;">[Settings]<br />Priority=IncludeExitScripts, Default<br />Properties=ExitScripts</span></p>
<span style="font-family:Consolas;"></span>
<p><span style="font-family:Consolas;">[IncludeExitScripts]<br />UserExit=MDTExitInclude.vbs<br />ExitScripts=#IncludeFiles(&quot;MDTLibHelperClasses.vbs,ModelAliasExit.vbs,MDTConfigMgrFunctions.vbs&quot;)#</span></p>
</blockquote>
<p>The latest version of <strong>MDTExitInclude.vbs</strong> is attached below.</p>
<p>&nbsp;</p>
<p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/about/legal/en/us/IntellectualProperty/Copyright/Default.aspx">Terms of Use</a><strong></strong><strong>.</strong></p>
<p><em>This post was contributed by <strong>Michael Murgolo,</strong> a Senior Consultant with Microsoft Services - U.S. East Region.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/6127/00/00/03/65/15/91/MDTExitInclude.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6127-00-00-03-65-15-91/MDTExitInclude.zip">MDTExitInclude.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Reducing Windows Deployment time using Power Management</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/reducing-windows-deployment-time-using-power-management</link>
      <pubDate>Thu, 26 Mar 2015 18:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Hunter]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/03/26/reducing-windows-deployment-time-using-power-management/</guid>
      <description><![CDATA[The following post was contributed by Benjamin Rampe a Senior PFE working for Microsoft.
While...]]></description>
      <content:encoded><![CDATA[<p><em>The following post was contributed by Benjamin Rampe a Senior PFE working for Microsoft.</em></p>
<p>While studying up on Windows 10, I came across a technique that has been shown to reduce the time it takes to apply an OS WIM to disk by 20 &ndash; 50%*.&nbsp; That&rsquo;s a fairly significant savings in time and the implementation of this technique is relatively easy and does not require you to change how you deploy Windows.&nbsp; Believe it or not, the savings come from adjusting the OS power management settings during a deployment.&nbsp; While there are multiple ways to implement these power management settings, below I&rsquo;ve outlined what I consider the most non-intrusive to existing deployment methods.&nbsp;</p>
<p><span style="text-decoration:underline;"><strong>Steps: </strong></span></p>
<p>1. Copy PowerCfg.exe binaries to MDT Files package&rsquo;s Scripts subfolder</p>
<ul>
<li>By default, WinPE runs with the power management scheme set to &ldquo;Balanced&rdquo;</li>
<li>ConfigMgr 2012 R2&rsquo;s boot images use WinPE v5.0 which is based on the Windows 8.1 OS</li>
<li>PowerCfg.exe is necessary for changing the power management scheme</li>
<li>PowerCfg.exe is not included in WinPE</li>
<li>Create subfolders in the MDT Files package&rsquo;s Scripts subfolder for each architecture, as shown below:</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image00211_42608B06.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image00211_5F00_42608B06.jpg"><img width="603" height="331" style="display:inline;border:0px;" alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image00211_thumb_3DEA0A3F.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image00211_5F00_thumb_5F00_3DEA0A3F.jpg" border="0" /></a></p>
<ul>
<li>From a system running Windows 8.1 (or Server 2012 R2) copy %WINDIR%\System32\PowerCfg.exe to the AMD64 folder in the MDT Files package Scripts folder</li>
<li>From a system running Windows 8.1 (or Server 2012 R2) copy %WINDIR%\SysWOW64\PowerCfg.exe to the x86 folder in the MDT Files package Scripts folder</li>
<li>Update distribution points for the MDT Files package (Note: SysWOW64 contains 32 bit files hence we use this folder.)</li>
</ul>
<p>2. Insert a step early in the task sequence to set the power management scheme to &ldquo;High performance&rdquo;</p>
<ul>
<li>The GUID for the High performance scheme is &ldquo;8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c&rdquo;</li>
<li>The GUIDs for the default power management schemes in Windows are consistent between Windows versions (Vista and later)</li>
<li>The first instance of this action is for setting the power scheme during a REFRESH scenario (which starts in the full/old Windows OS).&nbsp; In this scenario, we want to execute the PowerCfg.exe native binary included in the OS (not the version in the MDT Files package).&nbsp; The Command line for this instance should be:&nbsp; &ldquo;PowerCfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c&rdquo;.&nbsp; To ensure this action only runs during a REFRESH scenario, the condition on this step should be &ldquo;_SMSTSInWinPE not equals TRUE&rdquo;</li>
<li>The second instance of this action is for setting the power scheme during a NEW COMPUTER scenario (which starts in WinPE).&nbsp; In this scenario, we want to execute the PowerCfg.exe binary included in the MDT Files package.&nbsp; The Command line for this instance should be:&nbsp; &ldquo;&quot;%DeployRoot%\Scripts\%PROCESSOR_ARCHITECTURE%\PowerCfg.exe&quot; /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c&rdquo;.&nbsp; To ensure this action only runs during a NEW COMPUTER scenario, the condition on this step should be &ldquo;_SMSTSInWinPE equals TRUE&rdquo;</li>
<li>The example below leverages the MDT-specific variable %DeployRoot% which gets instantiated only after a &ldquo;Use Toolkit Package&rdquo;, so be sure to insert the step to change the power scheme after the first &ldquo;Use Toolkit Package&rdquo; as shown below:</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image003_7BED843F.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image003_5F00_7BED843F.jpg"><img width="602" height="299" title="clip_image003" style="display:inline;border-width:0px;" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image003_thumb_77770378.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image003_5F00_thumb_5F00_77770378.jpg" border="0" /></a></p>
<p>3. After every &ldquo;Restart Computer&rdquo; step within the <b>Preinstall</b>, <b>Install</b>, and <b>Post Install</b>phases, insert another action to reset the power management scheme to &ldquo;High performance&rdquo; using the PowerCfg.exe from the MDT Files package.&nbsp; These 3 phases all run under WinPE which does not persist the power scheme between reboots.&nbsp; For example:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image005_45132FF9.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image005_5F00_45132FF9.jpg"><img width="602" height="277" title="clip_image005" style="display:inline;border-width:0px;" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image005_thumb_12AF5C7A.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image005_5F00_thumb_5F00_12AF5C7A.jpg" border="0" /></a></p>
<p>4. After the first &ldquo;Restart Computer&rdquo; step within the <b>State Restore</b>phase, insert another action to reset the power management scheme to &ldquo;High performance&rdquo; using PowerCfg.exe from the native (full) Windows OS as shown below.&nbsp; (NOTE:&nbsp; Perhaps a better alternative to implementing this step would be to set the power scheme to High performance prior to image capture which would provide the added benefit of using the High performance scheme during PnP enumeration, driver installation, etc.):</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image002_0F41930B.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image002_5F00_0F41930B.jpg"><img width="602" height="297" title="clip_image002" style="display:inline;border-width:0px;" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image002_thumb_23C6E289.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image002_5F00_thumb_5F00_23C6E289.jpg" border="0" /></a></p>
<p>5. Finally, set the power management scheme to the scheme you wish for the system to use after the deployment.&nbsp; In the example below, the GUID for the Balanced power scheme is set.&nbsp; GUIDs for the built-in power schemes in Windows can be found <a href="https://technet.microsoft.com/en-us/library/cc749019(v=ws.10).aspx">here</a>.&nbsp; To set the GUID for any custom scheme, use &ldquo;PowerCfg.exe &ndash;L&rdquo; to obtain the scheme&rsquo;s GUID and paste into the Command line for the action:&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image011_2FB80B42.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image011_5F00_2FB80B42.jpg"><img width="602" height="338" title="clip_image011" style="display:inline;border-width:0px;" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/clip_image011_thumb_443D5AC0.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/clip_5F00_image011_5F00_thumb_5F00_443D5AC0.jpg" border="0" /></a></p>
<p>Early results are very promising using this technique, we would love to hear if this improved the speed of your deployment via the comments.</p>
<p>*From Windows 10 for PCs and 2 in 1s Manufacturing End-to-End Overview &ndash; <a href="https://channel9.msdn.com/Events/WinHEC/2015/WDI201">https://channel9.msdn.com/Events/WinHEC/2015/WDI201</a></p>
<p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/info/cpyright.mspx"><strong>Terms of Use</strong></a><strong>.</strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Excluding Known Multi-Reboot Updates during a ZTI Deployment</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/excluding-known-multi-reboot-updates-during-a-zti-deployment</link>
      <pubDate>Tue, 10 Mar 2015 18:42:11 GMT</pubDate>
      <dc:creator><![CDATA[Ben Hunter]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/03/10/excluding-known-multi-reboot-updates-during-a-zti-deployment/</guid>
      <description><![CDATA[The following post was contributed by Cliff Jones a Consultant working for Microsoft Consulting...]]></description>
      <content:encoded><![CDATA[<p><em>The following post was contributed by Cliff Jones a Consultant working for Microsoft Consulting Services.</em></p> <p>Today&#39;s blog post goes behind the scenes to talk about how to prevent installing all published Windows Update&#39;s which require multiple reboots to successfully install, during a ZTI deployment Task Sequence. These updates can cause issues as a result of the following behavior; the Task Sequence engine is aware the update requests the initial reboot. Upon boot-up, the Task Sequence engine never initializes and therefore can&#39;t be aware that the same update is requiring a second reboot, and thus finally won&#39;t make the necessary changes to restart the TS engine again. When the second reboot occurs, during the deployment, the TS will be in an erroneous state, and will cause an error similar to:</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&quot;Task Sequence environment not found&quot;</span></p> <p>Ideally, these updates should be injected using DISM during the Offline phase of installation, or added during the Build and Capture as the LTI process is not affected by these updates. Either way, a detection and blocking mechanism is needed for your ZTI deployment process.</p> <p>The following script dynamically query’s the published Microsoft Support page and finds all KB&#39;s listed as problematic KB&#39;s. Once the list is generated it is up to the administrator to figure out how to block them. This blog post will walk through how to block these updates using MDT as deployment mechanism.</p> <p>Big thanks to <strong>@Dustin Martin</strong> for helping in finalizing this script&#39;s development.</p> <p>Below is a standalone version of the script:</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$url = &quot;https://support.microsoft.com/kb/2894518&quot;</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$i=1</span>&nbsp;</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">#Store Source HTML URL</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$result = Invoke-WebRequest $url</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">#Narrow Source HTML to just Hyperlinks</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$elements = $result.AllElements | Where Class -eq &quot;plink&quot;</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">#For Each hyperlink</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">foreach ($link in $elements.innertext)</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">{</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">#Find string &#39;/kb/&#39; and get its position</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">$pos = $link.indexof(&#39;/kb/&#39;) + 3</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;"># If &#39;/kb/&#39; not found $pos=-1 +3 = 2</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;"># Not found indicates non KB hyperlink</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">if ($pos -gt 3)</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; {</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; #Move the starting position to the start of the KB number and capture all char&#39;s to end</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; $sOutput = $link.Substring($pos,$link.Length-$pos)</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; #Replace &#39;/&#39; and &#39;)&#39; with nothing</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; $ExcludeKB = $sOutput.Replace(&#39;/&#39;,&#39;&#39;).Replace(&#39;)&#39;,&#39;&#39;).Trim()</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; #KB Number is stored in $ExcludeKB</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; Write-Host $ExcludeKB</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp; }</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">$i++&nbsp; </span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">}</span>&nbsp;</p> <h2><span style="font-family:calibri light;color:#2e74b5;">Script Functionality</span></h2> <p>Microsoft has committed to keeping the support page containing the list of problematic updates, up-to date. This support page is located here: <a href="https://support.microsoft.com/kb/2894518"><span style="color:#0563c1;">https://support.microsoft.com/kb/2894518</span></a><span style="text-decoration:underline;"><span style="color:#0563c1;">.</span></span></p> <p>The first function of this script is to go out and store all source code and HTML elements to a variable to be used for processing later.</p> <p>Continuing with the script break down, we can see our WebRequest call, which stores the source code of the support page in a variable called $result.</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$result = Invoke-WebRequest $url</span>&nbsp;</p> <p>If you echo $result you will see an enormous amount of information, numerous elements, housing their respective properties each contain the corresponding values.</p> <p>In order to reduce to this down into more usable objects, we only include the elements that have a class called &quot;Plink&quot;. Plink is an HTML item which contains a hyperlink. Using this class will include ALL hyperlinks contained within the page. In our case this contains ALL the problematic KB article pages, with some additional links.</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$elements = $result.AllElements | Where Class -eq &quot;plink&quot;</span></p> <p>Echo&#39;ing different properties of the object called $elements, we can see pertinent information. To find how many hyperlinks are contained within the class we can perform a count on the number of &quot;PLINK&quot;. Powershell objects ($elements) automatically contains the .Count property:</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_3FF18AC7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_3FF18AC7.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;margin-left:0px;display:inline;border-top-width:0px;margin-right: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/00/61/27/metablogapi/image_thumb_066E7AD0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_066E7AD0.png" width="640" align="left" height="28" /></a><img alt=" " />&nbsp;</p> <p>Because $Elements is an object, and contains more than 1 item, we must iterate through each item. Taking the count from above into consideration, we can echo specific $element items to view all the associated properties and their values. The first item starts at [0] and goes to [12], since there are 13 total. Below we can see the first PLINK item&#39;s [0] data to work with:</p> <p><span style="font-size:medium;font-family:times new roman;"></span>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_48E11D06.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_48E11D06.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_00B8828C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_00B8828C.png" width="640" height="160" /></a> </p> <p>By observing $elements[0], we now know the specific property to enumerate during the entire item iteration. In the end this property is used to generate the entire exclude KB list.</p> <p>In PowerShell a ForEach loop automatically loops through all of a collection of items. In the current usage the collection is $elements with each item [X] assigned to the variable $link. Each time the loop occurs the $link is reset, meaning it only ever contains 1 value equal to the respective $elements[X].innertext. This string is then to be used in the processing section of the foreach loop.</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">foreach ($link in $elements.innertext)</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">{</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">*PROCESSING*</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">}</span></p> <p>Each string $link to be processed is assumed to be a hyperlink, and the desired KB number is at the very end of the string. These two made assumptions must be validated, thus ensuring script reliability. For this example we only require the KB number, and nothing more.</p> <p>To begin the necessary string cleansing, the position in the string, to begin processing must be known. For each line of $Elements.<em>innerText or $link=(</em><a href="https://support.microsoft.com/kb/XXXXXXXX"><em>https://support.microsoft.com/kb/XXXXXXXX</em></a><em>), </em>we will set the variable $POS to the numerical position of the start of &#39;/kb/&#39;. The next 3 characters will always be &#39;kb/&#39;, knowing this simply adding 3 to move our position to the final / after KB, creates our desired starting point.</p> <p>This position number is important because not only does it provide our initial modification location but also serves as a validation test. Remember earlier when the PLINK class was used as a filter, and it included all items with a hyperlink and not just instances of the KB hyperlink? By searching for &#39;/KB/&#39; specifically, all non KB hyperlinks are eliminated. If &#39;/KB/&#39; is not found $POS will equal -1, again, meaning &#39;/KB&#39; was not found.</p> <p>Below is an example of the index number for items [1] and [12]:</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_0E1E9592.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_0E1E9592.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_22A3E510.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_22A3E510.png" width="640" height="62" /></a> </p> <p>Using an If statement, only valid KB hyperlink&#39;s will have an index number ($POS) greater than 3.</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">if ($pos -gt 3)</span></p> <p>There are just a few more items to take into consideration when cleansing the KB hyperlink string. At this point the string is just &#39;/#######*&#39;. The document says * when in reality there are two different possibilities, which are a &#39;/&#39; or a &#39;)&#39;. It is inconsistent but simple enough to correct either. Using Powershell&#39;s substring method, provide a string, the starting point, and the length or number of characters to save.</p> <p>In our example we use $link which currently is <em>(</em><a href="https://support.microsoft.com/kb/2984976"><em>https://support.microsoft.com/kb/2984976</em></a><em>)</em>, move our starting point to $pos, or 32 characters in from the left, and save all the characters from the starting point to the end. We can dynamically control the characters being saved, (length) by taking the total string length and subtracting it from our starting point $pos and that equals the remainder of the string.</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$link.Substring($pos,$link.Length-$pos)</span></p> <p>When we do this and echo our sOutput variable we can see there is just one more tweak to do to completely cleanse the KB hyperlink. Below is that output:</p> <p><span style="font-size:medium;font-family:times new roman;"></span>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_6920D518.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_6920D518.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_727C9A4C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_727C9A4C.png" width="640" height="232" /></a> </p> <p>The last item is to remove the &#39;/&#39; and &#39;)&#39; from each of the strings and the string cleansing will be complete. Luckily Powershell provides a Replace method much like the substring method. The replace method requires a string, the character to look for, and what to replace that character with.</p> <p>We will simply replace both the &#39;/&#39; and &#39;)&#39; with nothing, and then ensure all trailing blank spaces are removed. Below is our needed replace scenario example:</p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$sOutput.Replace(&#39;/&#39;,&#39;&#39;).Replace(&#39;)&#39;,&#39;&#39;).Trim()</span></p> <p>And finally the corresponding output:</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_6D99E690.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_6D99E690.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_2644909E.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_2644909E.png" width="640" height="259" /></a> </p> <p><span style="font-size:medium;font-family:times new roman;"></span>At this point you all the KB numbers have been found and properly sanitized for use. Once sanitized how can this be put to use? Well of course we need to integrate it into the ConfigMgr deployment task sequence :).<br /><span style="font-family:calibri light;color:#2e74b5;"></span></p> <h4>Deployment</h4> <p>Some modifications needed to be made to the script in-order to make it usable during deployment. The overall script functionality is exactly the same as above, the modifications were made to make the script more memory efficient and functionally able to utilize Task Sequence environment variables.</p> <h3><span style="font-family:calibri light;color:#1f4d78;">CheckBadKB.ps1</span></h3> <p style="margin-left:30px;"><span style="font-size:medium;font-family:calibri;">&nbsp;</span><span style="font-family:courier new,courier;">$i=1</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$tsEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$url = &quot;https://support.microsoft.com/kb/2894518&quot;</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$result = Invoke-WebRequest $url</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">$result.AllElements | Where Class -eq &quot;plink&quot; | ForEach-Object {</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">$pos = $_.innertext.indexof(&#39;/kb/&#39;) + 3</span><span style="font-family:courier new,courier;">&nbsp;</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">#If Valid KB Hyperlink</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">if ($pos -gt 3)</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">{</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #String Cleansing, final ExcludeKB = 1234567</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ExcludeKB = $_.innertext.Substring($pos,$_.innertext.Length-$POS).Trim().Replace(&#39;/&#39;,&#39;&#39;).Replace(&#39;)&#39;,&#39;&#39;)&nbsp;&nbsp; </span><span style="font-family:courier new,courier;">&nbsp; </span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #This Write-Host can be found in CheckBadKB.log file.&nbsp;&nbsp; </span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Run Powershell script step will output automatically to selfcreated log file</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host &quot;WUMU_ExcludeKB$i=&quot; $ExcludeKB</span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tsEnv.Value(&quot;WUMU_ExcludeKB$i&quot;) = $ExcludeKB</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">}</span></p> <p style="margin-left:60px;"><span style="font-family:courier new,courier;">$i++&nbsp; </span></p> <p style="margin-left:30px;"><span style="font-family:courier new,courier;">}</span></p> <h3><span style="font-family:calibri light;color:#1f4d78;">Task Sequence Modifications</span></h3> <p>This deployment section of the blog post is intended to provide an example methodology to prevent these problematic patches from applying during the ZTI TS. The components of this section should provide an 80% completed solution with the remaining 20% being requirements gathering and final implementation. The proper process to prevent these updates from failing your ZTI deployment, will vary from customer to customer based on their requirements.  <p>In this blog&#39;s example we have integrated MDT with Configuration Manager and no longer use the default Configuration Manager step &quot;Install Software Updates&quot;. Instead the MDT script ZTIWindowsUpdate.wsf is called.  <p>A few notes about using this demo methodology in production: <ul> <li>This is not a supported Microsoft scenario, Microsoft will require the default Install Software Update Step be used, if problems arise.</li> <li>This will completely bypass the Software Update Point, and each client will download the updates either from a Standalone WSUS Server (if specified) or from Microsoft&#39;s public Windows Update site.</li></ul> <p>The CheckForBadKB.ps1 script currently needs to run Online and the client must have internet access. Below our two figures show how our example utilizes the example prevention process.  <p><strong>Figure 1</strong> shows a &#39;Run Powershell Script&#39; step to run immediately before the demonstration step MDT Install Software Updates. <p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_417CE99F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_417CE99F.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_5CB542A0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_5CB542A0.png" width="640" height="579" /></a> </p> <p><strong>Figure 2</strong> shows a &#39;Run Command Line&#39; step to run the ZTIWIndowsUpdate.wsf script to apply Windows Updates</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/61/27/metablogapi/image_595B8AFB.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_595B8AFB.png"><img title="image" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-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/00/61/27/metablogapi/image_thumb_4DC5CDBC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-61-27-metablogapi/image_5F00_thumb_5F00_4DC5CDBC.png" width="640" height="579" /></a>&nbsp;</p> <h3><span style="font-family:calibri light;color:#1f4d78;">Verifying on Client Side</span></h3> <p>Once everything has been configured we need to verify on our client side that things are working. Once the CheckBadKB script runs it will generate a log file for itself, located in the normal SMS TS Log path locations. This CheckBadKB.log file should indicate all the KB&#39;s added to the exclude list. Below Highlighted in bold is that process happening:</p> <h4>CheckBadKB.log</h4> <p><span style="font-family:courier new,courier;">&lt;![LOG[WUMU_ExcludeKB1=]LOG]!&gt;&lt;time=&quot;18:06:53.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[ ]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[2984976]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[WUMU_ExcludeKB2=]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[ ]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[2981685]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[WUMU_ExcludeKB3=]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[ ]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[2966034]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[WUMU_ExcludeKB4=]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[ ]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[2965788]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;"><b>&lt;![LOG[WUMU_ExcludeKB5=]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</b></span></p> <p><span style="font-family:courier new,courier;"><b>&lt;![LOG[ ]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</b></span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[2920189]LOG]!&gt;&lt;time=&quot;18:06:54.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;TaskSequencePSHost&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;TaskSequencePSHost&quot;&gt;</span></p> <p></p> <p>Once the Windows Update step starts to run, if we monitor the ZTIWindowsUpdate.log file we can see our targeted KB&#39;s, being skipped during the update installation process. Below in bold is that process occurring:</p> <h4>ZTIWindowsUpdate.log</h4> <p><span style="font-family:courier new,courier;">&lt;![LOG[INSTALL - b1d4e91a-26a7-4215-b0d5-7819b7ee125a - Windows Malicious Software Removal Tool for Windows 8, 8.1 and Windows Server 2012, 2012 R2 x64 Edition - November 2014 (KB890830) - 31 MB]LOG]!&gt;&lt;time=&quot;21:52:17.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;ZTIWindowsUpdate&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;ZTIWindowsUpdate&quot;&gt;</span></p> <p><span style="font-family:courier new,courier;"><b>&lt;![LOG[&nbsp; SKIP&nbsp; - c4f97de4-bdad-4d50-9a24-07d241040b0f - Security Update for Windows 8.1 for x64-based Systems (KB2920189) - 10 MB]LOG]!&gt;&lt;time=&quot;21:52:17.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;ZTIWindowsUpdate&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;ZTIWindowsUpdate&quot;&gt;</b></span></p> <p><span style="font-family:courier new,courier;">&lt;![LOG[INSTALL - fb3da1f2-6a6e-4f4a-b25c-a05af3974acc - Security Update for Internet Explorer Flash Player for Windows 8.1 for x64-based Systems (KB3018943) - 17 MB]LOG]!&gt;&lt;time=&quot;21:52:17.000+000&quot; date=&quot;11-28-2014&quot; component=&quot;ZTIWindowsUpdate&quot; context=&quot;&quot; type=&quot;1&quot; thread=&quot;&quot; file=&quot;ZTIWindowsUpdate&quot;&gt;</span></p> <p><strong></strong>&nbsp;</p> <p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/info/cpyright.mspx"><strong>Terms of Use</strong></a><strong>.</strong></p></p></p></p></p></p>]]></content:encoded>
    </item>
    <item>
      <title>Configuring Regional and Language Settings Online in an MDT Task Sequence – Script Update</title>
      <link>https://docs.microsoft.com/archive/blogs/deploymentguys/configuring-regional-and-language-settings-online-in-an-mdt-task-sequence-script-update</link>
      <pubDate>Fri, 27 Feb 2015 11:12:39 GMT</pubDate>
      <dc:creator><![CDATA[Michael Murgolo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/deploymentguys/2015/02/27/configuring-regional-and-language-settings-online-in-an-mdt-task-sequence-script-update/</guid>
      <description><![CDATA[A few years ago I authored a post about this topic.&nbsp; You can find it here.&nbsp; I recently had...]]></description>
      <content:encoded><![CDATA[<p>A few years ago I authored a post about this topic.&nbsp; You can find it <a href="https://blogs.technet.com/b/deploymentguys/archive/2010/01/20/configuring-regional-and-language-settings-online-in-an-mdt-task-sequence.aspx" target="_blank">here</a>.&nbsp; I recently had an engagement where I had to do this again.&nbsp; In the process of doing this I made a few changes/improvements to the script.&nbsp; I’ve added the download for the new script here and updated the download of the original post as well.</p> <p>Most of the changes are internal improvements to the script.&nbsp; I won’t go into most of those here but you can find the details in the header block and revision notes of the script.&nbsp; One that I will discuss is the change to the handling of the KeyboardLocale setting.&nbsp; MDT (and the unattend.xml InputLocale setting that MDT fills in with this value) allows this setting to be specified as language-REGION text (e.g. en-US) or hex codes (e.g. 0409:00000409).&nbsp; The XML file generated by this script only supports the hex codes.&nbsp; So now if the script sees a text entry in KeyboardLocale it will use ListOfLanguages.xml (in the Scripts folder of the MDT Deployment Share or MDT Toolkit ConfigMgr package) to convert it to hex codes.</p> <p>One other change is that the script now supports a UILanguageFallback custom property to allow specification of the Fallback language when the UILanguage is not fully localized, like the unattend.xml setting: <a title="https://technet.microsoft.com/en-us/library/ff716433.aspx" href="https://technet.microsoft.com/en-us/library/ff716433.aspx">https://technet.microsoft.com/en-us/library/ff716433.aspx</a>.</p> <p>The engagement where I made these changes was a Windows 7 migration, so I have not had a chance to see if/how well this might work on Windows 8.x.&nbsp; If you try this, post a comment about it here.</p> <p>&nbsp;</p> <p><strong>Disclaimer: The information on this site is provided &quot;AS IS&quot; with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the </strong><a href="https://www.microsoft.com/info/cpyright.mspx"><strong>Terms of Use</strong></a><strong>.</strong> <p><em>This post was contributed by <b>Michael Murgolo,</b> a Senior Consultant with Microsoft Services - U.S. East Region.</em></p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/6127/00/00/03/64/57/74/RegionalSettings.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6127-00-00-03-64-57-74/RegionalSettings.zip">RegionalSettings.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>