<?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>Israel Platforms PFE Team</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/isrpfeplat/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 04 Mar 2016 03:45:49 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>PowerShell: Get-ServiceAccountUsage</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/powershell-get-serviceaccountusage</link>
      <pubDate>Mon, 02 Jan 2012 03:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Martin Schvartzman]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2012/01/02/powershell-get-serviceaccountusage/</guid>
      <description><![CDATA[If you ever needed to know if and where a certain user account was being used to run a service, a...]]></description>
      <content:encoded><![CDATA[<p>If you ever needed to know <strong><em>if</em></strong> and <strong><em>where</em></strong> a certain user account was being used to run a service, a scheduled task or an application pool, then you’ll find this post helpful.</p>  <p>SOX regulations, security procedures or your boss may require you to have the password periodically changed for accounts running services, scheduled tasks or IIS application pools.    <br />Before you go ahead and change the password, you should either have a detailed list of <strong><em>who</em></strong> (the user account) runs <strong><em>what</em></strong> (the service, task or application pool) and <strong><em>where</em></strong> (on which computer), or use a script to get this information, so after you change the account’s password in the domain, you can go to all those services, scheduled tasks or application pools on the different computers and change the password settings.</p>  <p>Since I needed to do just that, I’ve decided to write a PowerShell function that can scan a computer (or an array of computers) and list all those services, scheduled tasks or application pools.</p>  <p>   <br /><span style="text-decoration: underline">Services</span>     <br />Getting the services information was easy, using the <a href="https://technet.microsoft.com/en-us/library/dd315295" target="_blank"><strong>Get-WmiObject</strong></a> cmdlet and querying the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa394418" target="_blank"><strong>Win32_Service</strong></a> Class, especially getting the <strong>StartName</strong> property: </p>  <div id="codeSnippetWrapper"><span style="font-size: x-small" size="2">     <div id="codeSnippetWrapper">       <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">Get-WmiObject -Namespace root\cimv2 -Class Win32_Service -ComputerName $Computer ...</font></pre>
    </div>
  </span>

  <br /><span style="text-decoration: underline">Filtering</span> 

  <br />The most important issue was to filter the services, and get only the ones running by a specific user account, or by all accounts other than the built-in ones (e.g. LocalSystem, LocalService, NetworkService, etc.). 

  <br />Filtering using the <strong>–Filter</strong> parameter or using the <strong>‘where’</strong> directive in the full <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa394606.aspx" target="_blank"><strong>WQL</strong></a> query has better performance than filtering using the <a href="https://technet.microsoft.com/en-us/library/dd315399" target="_blank"><strong>Where-Object</strong></a> cmdlet. 

  <br />This way, instead of retrieving all the services from the remote machine and only then filtering out the specific ones, you get the filtered out list right away. 

  <br />Related reading: <a href="https://technet.microsoft.com/en-us/magazine/2009.09.windowspowershell.aspx">https://technet.microsoft.com/en-us/magazine/2009.09.windowspowershell.aspx</a></div>

<p>
  <br /><span style="text-decoration: underline">Scheduled Tasks 
    <br /></span>Getting the Scheduled Tasks information was a different challenge. I thought about using the <a href="https://msdn.microsoft.com/en-us/library/aa383607" target="_blank"><strong>Schedule.Service</strong></a> com object, and parsing the <a href="https://msdn.microsoft.com/en-us/library/aa382099" target="_blank">xml</a> property:</p>

<div>
  <div><span style="font-size: x-small" size="2">
      <div id="codeSnippetWrapper">
        <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">$sch = New-Object -ComObject Schedule.Service<br />$sch.Connect($Computer)<br />$tasks = $sch.GetFolder(&quot;\&quot;).GetTasks(0)<br />$tasks | Where-Object { ([xml]$_.xml).Task.Principals.Principal.UserID <span style="color: #cc6633">-eq</span> $UserAccount }</font></pre>

        <br /></div>
    </span>But the Schedule.Service com object is available only on Windows Vista and above, and since I needed it to run on Windows 2003 machines too, I ended up using the plain and simple native SCHTASKS command:</div>
</div>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">SCHTASKS /QUERY /S $Computer ...</font></pre>

  <br /></div>

<div>I used the <strong>/FO CSV</strong> and the <strong>/V</strong> switches to have a verbose CSV formatted output, and the <a href="https://technet.microsoft.com/en-us/library/dd315368" target="_blank"><strong>ConvertFrom-CSV</strong></a> cmdlet to get the results back into an array of <a href="https://msdn.microsoft.com/en-us/library/system.management.automation.pscustomobject" target="_blank"><strong>PSCustomObjects</strong></a>.</div>

<div>&#160;</div>

<p><span style="text-decoration: underline">Filtering 
    <br /></span>This time, I needed to filter the results using the <strong>Where-Object</strong> cmdlet which accepts a scriptblock in the <strong>–FilterScript</strong> parameter. So for the specific user (“explicit” scenario) I used the <strong>–like</strong> <a href="https://technet.microsoft.com/en-us/library/dd315321" target="_blank">comparison operator</a>: </p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">$TaskFilter = { $_.{Run As User} <span style="color: #cc6633">-like</span> $UserAccount }</font></pre>

  <br /></div>

<p>For the non-built-in accounts (“implicit” scenario), I used the <strong>–notcontains</strong> comparison operator with an array of strings to exclude: </p>

<div id="codeSnippetWrapper"><span style="color: #000000; font-size: x-small" size="2" color="#000000">
    <div id="codeSnippetWrapper">
      <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">$TaskSystemAccounts = @(<span style="color: #006080">&quot;INTERACTIVE&quot;</span>, <span style="color: #006080">&quot;SYSTEM&quot;</span>, <span style="color: #006080">&quot;NETWORK SERVICE&quot;</span>, <span style="color: #006080">&quot;LOCAL SERVICE&quot;</span>,<br /> <span style="color: #006080">&quot;Run As User&quot;</span>, <span style="color: #006080">&quot;Authenticated Users&quot;</span>, <span style="color: #006080">&quot;Users&quot;</span>, <span style="color: #006080">&quot;Administrators&quot;</span>, <span style="color: #006080">&quot;Everyone&quot;</span>, <span style="color: #006080">&quot;&quot;</span>)<br />$TaskFilter = { $TaskSystemAccounts -notcontains $_.{Run As User} }</font></pre>

      <br /></div>
  </span>

  <br />

  <br /><span style="text-decoration: underline">IIS ApplicationPools</span> 

  <br />Getting the IIS Application Pools information depends on the operating system version, or to be exact: it depends on the IIS version. 

  <br />For IIS 6 (on Windows 2003), the <a href="https://msdn.microsoft.com/en-us/library/ms525265" target="_blank"><strong>MicrosoftIISv2</strong></a> WMI namespace and the <strong><a href="https://msdn.microsoft.com/en-us/library/ms524484" target="_blank">IIsApplicationPoolSetting</a></strong> class had the all information I needed. The instance’s <a href="https://msdn.microsoft.com/en-us/library/ms524699" target="_blank"><strong>WAMUserName</strong></a> property contains the ApplicationPool identity, and when the <a href="https://msdn.microsoft.com/en-us/library/ms524908" target="_blank"><strong>AppPoolIdentityType</strong></a> equals to 3 (MD_APPPOOL_IDENTITY_TYPE_SPECIFICUSER) it means that it is a specific user and not any of the built-in accounts.</div>

<p>Although the <strong>MicrosoftIISv2</strong> WMI namespace may be available on IIS 7/7.5 (if you’ve installed the <strong>IIS 6 WMI compatibility</strong> on the machine), but the correct way would be to query the <a href="https://msdn.microsoft.com/en-us/library/aa347459" target="_blank"><strong>WebAdministration</strong></a> WMI namespace (part of the IIS Management Scripts and Tools <a href="https://technet.microsoft.com/en-us/library/cc753473" target="_blank">Web-Server role services</a>) 

  <br />The <a href="https://msdn.microsoft.com/en-us/library/ms691399" target="_blank"><strong>ProcessModel</strong></a><strong>.UserName</strong> (in the <a href="https://msdn.microsoft.com/en-us/library/ms690608" target="_blank"><strong>ApplicationPool</strong></a> class) is the property that contains the ApplicationPool identity, and when the <strong>ProcessModel.IdentityType</strong> equals to 3, it means that it is a specific user and not any of the built-in accounts.</p>

<p><span style="text-decoration: underline">Alternate credentials (and splatting paramters)</span> 

  <br />After testing the function a few times, it occurred to me that I (or anyone else using the function) may want to use alternate credentials to connect to the remote computer(s). 

  <br />Lucky me, the Get-WmiObject has a <strong>–Credential</strong> parameter that accepts a <strong>PSCredential</strong> object. 

  <br />So I decided to use the <a href="https://technet.microsoft.com/en-us/magazine/gg675931" target="_blank">splatting</a> technique, by creating a hashtable with all parameters to be passed to the cmdlet, and add or remove parameters if needed. For example, WMI does not support connecting to the local computer using credentials. So if the user supplied alternate credentials and the computer being queried is the local machine, the –Credential needs to be removed from the parameters hashtable. </p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2"><span style="color: #0000ff">if</span> (@(<span style="color: #006080">&quot;$ENV:COMPUTERNAME&quot;</span>,<span style="color: #006080">&quot;localhost&quot;</span>,<span style="color: #006080">&quot;127.0.0.1&quot;</span>,<span style="color: #006080">&quot;::1&quot;</span>) -contains $Computer) { <br /> $ParamServices.Remove(<span style="color: #006080">&quot;Credential&quot;</span>)...</font></pre>

  <br /></div>

<p>For the Scheduled tasks, there are two parameters: <strong>/U</strong> and <strong>/P</strong> that accept the User and Password (respectively) for the remote connections. 

  <br /><strong>IMPORTANT:</strong> Please note that the value of the password is translated into clear text before passed to the command.</p>

<p>&#160;</p>

<p><u>Parameter Sets</u> 

  <br />Since I needed to have two options for running the function: 

  <br /><strong>&#160; A.</strong> When I know which account to look for (the exact name, or using wildcards). A.k.a. the “<strong>Explicit</strong>” scenario. 

  <br /><strong>&#160; B.</strong> When I want the function to get the Services, Scheduled Tasks and ApplicationPools that are running under any account other than the built-in accounts.&#160; A.k.a. the “<strong>Implicit</strong>” scenario. 

  <br />I created two ParameterSets accordingly, and assigned the <strong>-UserAccount</strong> parameter in the <strong>Explicit</strong> ParameterSet, and the -<strong>NonSystemAccounts</strong> in the <strong>Implicit</strong> ParameterSet. 

  <br />This way, I got my two options for running the function. See the two syntax lines in the snapshot below (Click to enlarge).</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/0083.Get-Help-Get-ServiceAccountUsage_17023891.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0083.Get_2D00_Help_2D00_Get_2D00_ServiceAccountUsage_5F00_17023891.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Get-Help Get-ServiceAccountUsage" border="0" alt="Get-Help Get-ServiceAccountUsage" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5857.Get-Help-Get-ServiceAccountUsage_thumb_15DD29A5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5857.Get_2D00_Help_2D00_Get_2D00_ServiceAccountUsage_5F00_thumb_5F00_15DD29A5.png" width="244" height="115" /></a> 

  <br /></p>

<p>Then I only had to check what ParameterSet was used, and set the relevant filters accordingly:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2"><span style="color: #0000ff">switch</span> ($PsCmdlet.ParameterSetName) {<br />    <span style="color: #006080">'Explicit'</span>  { <br />        $ServiceFilter = <span style="color: #006080">&quot;StartName LIKE '$(($UserAccount).Replace(&quot;</span>\<span style="color: #006080">&quot;,&quot;</span>\\<span style="color: #006080">&quot;).Replace(&quot;</span>*<span style="color: #006080">&quot;,&quot;</span>%<span style="color: #006080">&quot;))'&quot;</span><br />        $TaskFilter = { $_.{Run As User} <span style="color: #cc6633">-like</span> $UserAccount }<br />        $IIS6Filter = <span style="color: #006080">&quot;WAMUserName LIKE '$(($UserAccount).Replace(&quot;</span>\<span style="color: #006080">&quot;,&quot;</span>\\<span style="color: #006080">&quot;).Replace(&quot;</span>*<span style="color: #006080">&quot;,&quot;</span>%<span style="color: #006080">&quot;))'&quot;</span><br />        $IIS7Filter = <span style="color: #006080">&quot;ProcessModel.UserName LIKE '$(($UserAccount).Replace(&quot;</span>\<span style="color: #006080">&quot;,&quot;</span>\\<span style="color: #006080">&quot;).Replace(&quot;</span>*<span style="color: #006080">&quot;,&quot;</span>%<span style="color: #006080">&quot;))'&quot;</span><br />        <span style="color: #0000ff">break</span><br />        } <br />    <span style="color: #006080">'Implicit'</span>  { <br />        $ServiceFilter = <span style="color: #006080">&quot;(NOT StartName LIKE '%LocalSystem') AND (NOT StartName LIKE '%LocalService') AND (NOT StartName LIKE '%NetworkService') AND (NOT StartName LIKE 'NT AUTHORITY%')&quot;</span><br />        $TaskSystemAccounts = <span style="color: #006080">'INTERACTIVE'</span>, <span style="color: #006080">'SYSTEM'</span>, <span style="color: #006080">'NETWORK SERVICE'</span>, <span style="color: #006080">'LOCAL SERVICE'</span>, <span style="color: #006080">'Run As User'</span>, <span style="color: #006080">'Authenticated Users'</span>, <span style="color: #006080">'Users'</span>, <span style="color: #006080">'Administrators'</span>, <span style="color: #006080">'Everyone'</span>, <span style="color: #006080">''</span>;<br />        $TaskFilter = { $TaskSystemAccounts -notcontains $_.{Run As User} }<br />        $IIS6Filter = <span style="color: #006080">'AppPoolIdentityType = 3'</span><br />        $IIS7Filter = <span style="color: #006080">'ProcessModel.IdentityType = 3'</span><br />        <span style="color: #0000ff">break</span><br />    }<br />}</font></pre>
</div>

<p>Related Reading: <a href="https://blogs.msdn.com/b/powershell/archive/2008/12/23/powershell-v2-parametersets.aspx">https://blogs.msdn.com/b/powershell/archive/2008/12/23/powershell-v2-parametersets.aspx</a></p>

<p>&#160;</p>

<p><span style="text-decoration: underline"></span></p>

<p><span style="text-decoration: underline">Managed Service Accounts and Virtual Accounts</span> 

  <br />Instead of using a regular user account as a service account that you need to manage its password, you can assign a computer (Windows 2008 R2 or Windows 7) a <strong>Managed Service Account</strong> (a.k.a. MSA). 

  <br />MSA’s allow you to create a special account in Active Directory that is tied to a specific computer. That account has its own complex password and is maintained automatically. This means that an MSA can run services on a computer in a secure and easy to maintain manner, while maintaining the capability to connect to network resources as a specific user principal. 

  <br />MSAs cannot be shared between multiple computers, thus cannot be used in server clusters where a service is replicated on multiple cluster nodes.</p>

<p><strong>Virtual accounts</strong> in Windows Server 2008 R2 and Windows 7 are &quot;managed local accounts&quot; that do not require any password management and have the ability to access the network with a computer identity in a domain environment (similar to Network service account).</p>

<p>Windows Server 2008 R2 domains provide native support for both automatic password management and SPN management of MSAs. 
  <br />If the domain controller is on a computer running Windows Server 2008 or Windows Server 2003 and the Active Directory schema has been upgraded to support this feature, managed service accounts can still be used and MSAs passwords will be managed automatically. However, the domain administrator will still need to manually configure the SPNs. 

  <br />Related reading:&#160; <a href="https://technet.microsoft.com/en-us/library/dd548356">https://technet.microsoft.com/en-us/library/dd548356</a> and <a href="https://support.microsoft.com/kb/2494158">https://support.microsoft.com/kb/2494158</a></p>

<p>
  <br />The <strong>Get-ServiceAccountUsage</strong> function can be downloaded from here: <a href="https://gallery.technet.microsoft.com/Get-ServiceAccountUsage-b2fa966f">https://gallery.technet.microsoft.com/Get-ServiceAccountUsage-b2fa966f</a> 

  <br />Please note that it is provided “<strong>as is</strong>” without warranty of any kind.</p>

<p>&#160;</p>

<p><u>FAQs:</u> 

  <br /><strong>Q:</strong> How do I use the function? 

  <br /><strong>A:</strong> The script file contains the <a href="https://gallery.technet.microsoft.com/Get-ServiceAccountUsage-b2fa966f" target="_blank">Get-ServiceAcco​untUsage</a> function. 

  <br />You need to &quot;<a href="https://blogs.technet.com/b/heyscriptingguy/archive/2010/08/09/how-do-i-use-a-windows-powershell-script-containing-functions.aspx" target="_blank">dot-source</a>&quot; the script file, to have the function declared in your scope, and then you can call it with whatever parameters you need. for example:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><font size="2">PS&gt; CD C:\myScripts<br />PS C:\myScripts&gt; . .\Get-ServiceAc​​countUsage.ps1<br />PS C:\myScripts&gt; Get-ServiceAcco​​untUsage -UserAccount <span style="color: #006080">'myDomain\myUse​​r'</span><br /></font></pre>

  <br /></div>

<p>&#160;</p>

<p>Stay tuned for the next post on the subject, where we’ll discuss Get-ServiceAccountUsage’s evil twin brother: <strong>Set-ServiceAccountUsage</strong>.</p>

<p>Martin.</p>]]></content:encoded>
    </item>
    <item>
      <title>Disaster Recovery Site and Active Directory (Part 3 of 3)</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/disaster-recovery-site-and-active-directory-part-3-of-3</link>
      <pubDate>Sun, 11 Dec 2011 06:14:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/12/11/disaster-recovery-site-and-active-directory-part-3-of-3/</guid>
      <description><![CDATA[Welcome to part 3 of the series… hopefully you have enjoyed the first two parts where we have...]]></description>
      <content:encoded><![CDATA[<p>Welcome to part 3 of the series… hopefully you have enjoyed the first two parts where we have discussed client logon and clients failover between Domain Controllers and sites.</p>  <p>In the last part of the series we're going to discuss Domain Controller replication failover between a Hub, Branch and DRP sites and different scenarios when doing so.</p>  <p>&#160;</p>  <p>While talking about AD replication, it's important to note that usually Active Directory replication isn't considered as the most critical service in the environment, and I absolutely agree.. An environment can work seamlessly when Active Directory replication is not working. Obviously having Active Directory not replicating for long periods of time may cause issues, inconsistencies and other problems (long period =&gt; Tombstone Life Time), but having AD not replicating in the middle of the night wouldn't get me out of bed running to my computer in order to fix the issue.. On the other hand, I would go and do that first thing in the morning.</p>  <p>&#160;</p>  <p>Now back to our environment.. again, we'll start with the simplest scenario, of one Domain Controller in each site:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2772.image_4AA7DA83.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2772.image_5F00_4AA7DA83.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/0638.image_thumb_0E9B98CE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0638.image_5F00_thumb_5F00_0E9B98CE.png" width="837" height="577" /></a></p>  <p>In our environment we have two Branch sites (Branch and Branch2) which are connected to the HUB site, each with a site link cost of 100.</p>  <p>The HUB site is connected to the DRP site with a site link cost of 10. Bridge All Site Links (BASL) is enabled in the environment. Having said that an attempt to calculate the routes in the environment would result in the following (ordered based on costs):</p>  <p><span style="text-decoration: underline"><strong>From Branch</strong></span></p>  <p>1. Branch –&gt; Hub = 100</p>  <p>2. Branch –&gt; DRP = 110 (Branch –&gt; HUB –&gt; DRP).</p>  <p>3. Branch –&gt; Branch2 = 200 (Branch –&gt; HUB –&gt; Branch2)</p>  <p>&#160;</p>  <p><span style="text-decoration: underline"><strong>From Branch2</strong></span></p>  <p>1. Branch2 –&gt; HUB = 100</p>  <p>2. Branch2 –&gt; DRP = 110 (Branch2 –&gt; HUB –&gt; DRP)</p>  <p>3. Branch2 –&gt; Branch = 200 (Branch2 –&gt; HUB –&gt; Branch).</p>  <p>&#160;</p>  <p>(A short reminder to make things clearer: BASL – Bridge All Site Links, means all site links are transitive. More information on BASL and AD replication topology can be found here - <a title="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx</a>).</p>  <p>&#160;</p>  <p>In that scenario it's obviously expected that the Branch sites (Branch and Branch2) would failover to the DRP site if the HUB site fails, instead of failing over to each other. (A matter of cost calculation, based on the table mentioned Branch –&gt; DRP is cheaper than Branch –&gt; Branch2).</p>  <p>So let's fail the DC in the HUB site…</p>  <p>&#160;</p>  <p>Running repadmin /showrepl on Child-DC04 would show we already have several failed attempts to replicate with the Domain Controller in the HUB site:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2308.image_64D81DDA.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2308.image_5F00_64D81DDA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/4861.image_thumb_3E95C482.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4861.image_5F00_thumb_5F00_3E95C482.png" width="853" height="641" /></a></p>  <p>&#160;</p>  <p>So the question is:</p>  <p><span style="text-decoration: underline"><strong>What are we waiting for?</strong></span></p>  <p>Well… the answer is this:</p>  <p><strong>IntersiteFailuresAllowed</strong></p>  <p>Value: Number of failed attempts</p>  <p>Default: 1</p>  <p>   <br /><strong>MaxFailureTimeForIntersiteLink (sec)</strong></p>  <p>Value: Time that must elapse before being considered unavailable, in seconds</p>  <p>Default: 7200 (2 hours)</p>  <p>&#160;</p>  <p>(All described here - <a title="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx</a> and <a title="https://technet.microsoft.com/en-us/library/cc961781.aspx" href="https://technet.microsoft.com/en-us/library/cc961781.aspx">https://technet.microsoft.com/en-us/library/cc961781.aspx</a>).</p>  <p>Basically we'll wait for 2 hours before the source DC for replication is considered stale. So in our scenario when we have failed the DC in the HUB site it would take 2 hours from the last replication attempt for the DCs in the Branch sites to consider the DC in the HUB site as stale.</p>  <p>After the time and the number of failures have elapsed we will get the following event:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1323.image_5F598769.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1323.image_5F00_5F598769.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/3806.image_thumb_0476D1D6.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3806.image_5F00_thumb_5F00_0476D1D6.png" width="646" height="485" /></a></p>  <p>Event ID 1308, stating that &quot;The Knowledge Consistency Checker (KCC) has detected that successive attempts to replicate with the following directory service has consistently failed.&quot; and that &quot;The Connection object for this directory service will be ignored, and a new temporary connection will be established to ensure that replication continues. Once replication with this directory service resumes, the temporary connection will be removed. &quot;</p>  <p>And a short while later we have received Event ID 2053: &quot;A new connection has been created to address site connectivity issues.&quot;</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8267.image_68F1CFD2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8267.image_5F00_68F1CFD2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/5852.image_thumb_2C795B28.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5852.image_5F00_thumb_5F00_2C795B28.png" width="663" height="603" /></a> </p>  <p>   <br />Looking at our environments Visio diagram now would show (as expected):</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5543.image_629AD377.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5543.image_5F00_629AD377.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/7534.image_thumb_463D6B8A.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7534.image_5F00_thumb_5F00_463D6B8A.png" width="731" height="509" /></a></p>  <p>Child-DC03 and Child-DC04 have created failover connection objects with Child-DC02, which is located at the DRP site, and vice versa, Child-DC02 has created failover connection objects with the DCs at the Branch and Branch2 sites.</p>  <p><span style="text-decoration: underline"><strong>So how long did this process take?</strong></span></p>  <p>Well – we need three events to take place:</p>  <p>1. At least one replication attempt to occur, meaning if the link to the HUB site has failed at 3PM, but we have a replication schedule on the site link configured to replicate only at 1AM we wouldn't even try to replicate before that time… so how would we know the site link has failed?!</p>  <p>2. After we have at least one failed replication attempt (stated in the InterSiteFailuresAllowed registry) we begin counting the Failure time – as stated in the &quot;MaxFailureTimeForIntersiteLink (sec)&quot; registry key.</p>  <p>3. After the MaxFailureTimeForInterSiteLink has elapsed we need KCC to run (which by default occurs every 15 minutes).</p>  <p>&#160;</p>  <p>So it very much depends on the environment how long it would take the failover connection objects to be created.</p>  <p>&#160;</p>  <p><span style="text-decoration: underline"><strong>What Can I do to make it faster?</strong></span></p>  <p>First of all, <strong>take things in perspective!</strong></p>  <p>if you replicate once in 24 hours, how bad can it be to be 48 hours without replication? Like I mentioned in the beginning of the post – Active Directory not replicating would not get me running anywhere, it would just one of those things on the TODO list&#160; (unless obviously it's a symptom for another issue – like all DCs have crashed on no one in the organization can work… well… I wouldn't consider that as a replication problem to be honest, but that's a matter of semantics cause I can see there's a replication issue there among other problems <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="חיוך קורץ" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3005.wlEmoticon-winkingsmile_43B439CC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3005.wlEmoticon_2D00_winkingsmile_5F00_43B439CC.png" />).</p>  <p>If you still feel the failover time is not enough, and you need to expedite the failover times you can set the &quot;MaxFailureTimeForIntersiteLink&#160; (sec)&quot; value to a lower value.</p>  <p>Again from <a title="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc755994(WS.10).aspx</a></p>  <p>Modifying the thresholds for excluding nonresponding servers requires editing the following registry entries in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters, with the data type REG_DWORD. You can modify these values to any desired value as follows:</p>  <p>For replication between sites, use the following entries:</p>  <ul>   <li><strong>IntersiteFailuresAllowed</strong>       <br />Value: Number of failed attempts       <br />Default: 1 </li>    <li><strong>MaxFailureTimeForIntersiteLink (sec)</strong>       <br />Value: Time that must elapse before being considered unavailable, in seconds       <br />Default: 7200 (2 hours) </li> </ul>  <p>&#160;</p>  <p>You will have to perform this on every DC in every Branch site (as those are the ones counting the fails).</p>  <p>You also need to take care while reducing this as having a very low value for this setting may cause false positives when failing between DCs, and since a failover can be an expensive operation we want to minimize the false positives as much as possible.</p>  <p><strong>Note: Whatever you do – Don't go creating manual connection objects! Manage the KCC and the topology of the environment to match your requirements, don't override it with manual connection objects.</strong></p>  <p>&#160;</p>  <p><span style="text-decoration: underline"><strong>Failing back</strong></span></p>  <p>Usually that's not a concern, but many times this question rises. What happens when the failed DC has come back online?</p>  <p>Well – KCC is aware of that when we have a successful replication attempt with the failed DC (and again, that's based on our replication topology, schedule and times).</p>  <p>So the next time KCC is run we will receive event 1129 stating &quot;To improve the replication load of Active Directory Domain Services, a replication connection from the following source directory service to the local directory service was deleted. &quot;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3731.image_0311ED5D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3731.image_5F00_0311ED5D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/1667.image_thumb_412B080E.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1667.image_5F00_thumb_5F00_412B080E.png" width="657" height="496" /></a></p>  <p>&#160;</p>  <p>So those temporary failover connection objects created for failover to the DR site are automatically deleted when the &quot;best&quot; DC (in our case – the DC at the HUB site) comes back online.</p>  <p>&#160;</p>  <p>So now that we know how failover works lets just briefly discuss the following scenario:</p>  <p><span style="text-decoration: underline"><strong>Two Domain Controllers in the HUB site        <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4403.image_0A017A15.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4403.image_5F00_0A017A15.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/7127.image_thumb_67C96E8E.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7127.image_5F00_thumb_5F00_67C96E8E.png" width="669" height="673" /></a></strong></span></p>  <p>Let's imagine that the physical site link between the Branch site and the HUB site have failed (to simulate that I'll shutdown the Active Directory Domain Services service on both DCs in the HUB site – Child-DC01 and Child-DC04.</p>  <p>So the first things occurs is exactly as previously: Child-DC03 (Branch) identifies that the current replication partner in the HUB site (Child-DC01) has failed and Event ID 1308 is generated on Child-DC03 (just as previously) stating &quot;The Knowledge Consistency Checker (KCC) has detected that successive attempts to replicate with the following directory service has consistently failed. &quot; and &quot;The Connection object for this directory service will be ignored, and a new temporary connection will be established to ensure that replication continues. Once replication with this directory service resumes, the temporary connection will be removed. &quot;.</p>  <p>&#160;</p>  <p><strong>Now is the different part:</strong></p>  <p>The new connection object that is generated is with<strong> Child-DC01 (</strong>HUB):</p>  <p>Event ID 2054 stating:</p>  <p>&quot;The Knowledge Consistency Checker (KCC) created a new bridgehead failover connection because the following bridgeheads used by existing site connections were not responding or replicating.&#160; <br />Servers:     <br />CN=NTDS Settings,CN=CHILD-DC04,CN=Servers,CN=HUB,CN=Sites,CN=Configuration,DC=trdemo,DC=local&quot;</p>  <p>was generated on <strong>Child-DC03.</strong></p>  <p>So Child-DC03 has failed over from Child-DC01 to Child-DC04. Is this the expected behavior???</p>  <p>The answer is yes! If you scroll back up you will note that I was stating all the time that we identify failed <strong>Domain Controllers. </strong>There is no possible way of identifying site link failures. So in terms of Active Directory replication <strong>a failed site is a site where all DCs are not responsive.</strong></p>  <p>And that's an important thing to remember. So in this scenario where we have two Domain Controllers in the HUB site we count the InterSiteFailuresAllowed and the &quot;MaxFailureTimeForIntersiteLink (sec)&quot; values for each Domain Controller in the site.</p>  <p>So with this scenario if the MaxFailureTimeForInterSiteLink is the default 2 hours we are talking 4 hours for failover to the DRP site.</p>  <p><strong>Now let's talk specifically about our test environment:</strong></p>  <p>I have set the MaxFailureTimeForIntersiteLink&#160; (sec) to a value of 300 seconds(decimal) – 5 minutes:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1185.image_250A2356.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1185.image_5F00_250A2356.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/2350.image_thumb_7814C07A.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2350.image_5F00_thumb_5F00_7814C07A.png" width="762" height="276" /></a></p>  <p>Meaning that 5 minutes of replication failures on an inter-site connection object would consider the source Domain Controller as failed.</p>  <p>So we have Child-DC01 and Child-DC04 failing since (<em>repadmin /showrepl</em> output on Child-DC03):</p>  <p><em>Source: HUB\CHILD-DC04      <br />******* 8 CONSECUTIVE FAILURES since 2011-12-11 12:58:52</em></p>  <p>So taking the times we have configured are:</p>  <p>12:58:52 + 5 minutes (MaxFailureForIntersiteLink time) = 13:03:52. So at 13:03:52 Child-DC04 will be considered stale, after which we'll wait for KCC to run.</p>  <p>Since KCC runs every 15 minutes it depends on where in the 15 minutes timeframe we catch the KCC.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/7140.image_6ED88539.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7140.image_5F00_6ED88539.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/4341.image_thumb_5A068CB9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4341.image_5F00_thumb_5F00_5A068CB9.png" width="635" height="580" /></a></p>  <p>The KCC is generating Event 1308 stating that it has identified the failed Domain Controller, followed by Event 2052 stating a new connection object has been created with Child-DC01 (as expected we try to failover between DCs in the HUB site):</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1205.image_109437FE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1205.image_5F00_109437FE.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/0537.image_thumb_7B560C88.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0537.image_5F00_thumb_5F00_7B560C88.png" width="641" height="588" /></a>     <br />&#160; <br />Next time the KCC is running (which is 15 minutes later @ 13:41:17) we still try to establish a connection object with Child-DC01 (or new selected server at the HUB site).</p>  <p>Next time KCC is run (that's at 13:56:17) we have identified Child-DC01 as a stale server:</p>  <p>Event ID 1307 stating that &quot;The Knowledge Consistency Checker (KCC) has detected that attempts to establish a replication link with the following directory service has consistently failed. &quot;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8551.image_038A3220.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8551.image_5F00_038A3220.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/2210.image_thumb_20AFDA2A.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2210.image_5F00_thumb_5F00_20AFDA2A.png" width="652" height="593" /></a></p>  <p><strong>And only then we consider the HUB site as stale!</strong></p>  <p>And we have Event ID 1566 to support that:</p>  <p>All directory servers in the following site that can replicate the directory partition over this transport are currently unavailable.&#160; <br />Site:     <br />CN=HUB,CN=Sites,CN=Configuration,DC=trdemo,DC=local </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5736.image_73F6FA83.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5736.image_5F00_73F6FA83.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/8407.image_thumb_788D053D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8407.image_5F00_thumb_5F00_788D053D.png" width="646" height="588" /></a></p>  <p>&#160;</p>  <p>So now we can failover to the DRP site:</p>  <p>Event ID 2053 is generated, stating that we have created a new connection object for failover, and this time it's with Child-DC02 located at the DRP site:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1122.image_6ADA4935.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1122.image_5F00_6ADA4935.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/2211.image_thumb_59A66B92.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2211.image_5F00_thumb_5F00_59A66B92.png" width="656" height="598" /></a></p>  <p>So overall the process took us about 1 hour to failover, and that's with the MaxFailureForIntersiteLink set to a very low value (5 minutes). So with the default setting of 2 hours you can expect 4-4.5 hours (depending on KCC intervals and where you catch them) to failover between a branch site and a HUB site containing two Domain Controllers.</p>  <p>&#160;</p>  <p><span style="text-decoration: underline"><strong>How can we make the process faster?</strong></span></p>  <p>Just as previously – <strong>Take things in perspective</strong>. Ask – what happens if my environment doesn't replicate for 5 hours? Do I even need to change anything?</p>  <p>If you do need to decrease the MaxFailureForIntersiteLink&#160; value again, take into consideration the false positives which may result if setting this value to a value which is too low.</p>  <p>&#160;</p>  <p>Now – if you feel like asking &quot;so what happens if I have 3 DCs in the HUB site?&quot; just use your own logic…<img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="חיוך קורץ" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3005.wlEmoticon-winkingsmile_43B439CC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3005.wlEmoticon_2D00_winkingsmile_5F00_43B439CC.png" /> (Let me give you a hint – We wait for MaxFailureForIntersiteLink for each DC).</p>  <p>&#160;</p>  <p>So hopefully it makes sense… now after I completely broke my Lab environment while writing this post I think I'm going to spend some time setting things back to Normal (e.g – Default).</p>  <p>Hope you enjoyed and it will make some more sense when troubleshooting/planning or testing your DRP scenarios.</p>  <p>And let me end on a cheerful note – <strong>A DRP site is not a DR Plan!!!</strong>&#160;<strong>In other words: Now that you got your DR site all sorted out, it's time to go and test your other DR scenarios!</strong></p>  <p>(And our colleagues from the UK have nicely listed all the scenarios in one place - <strong>&#160;<a title="https://blogs.technet.com/b/newenglandpfe/archive/2011/05/20/common-scenarios-for-active-directory-related-backup-and-disaster-recovery.aspx" href="https://blogs.technet.com/b/newenglandpfe/archive/2011/05/20/common-scenarios-for-active-directory-related-backup-and-disaster-recovery.aspx">https://blogs.technet.com/b/newenglandpfe/archive/2011/05/20/common-scenarios-for-active-directory-related-backup-and-disaster-recovery.aspx</a>).</strong></p>  <p>Hope we all never need it!</p>  <p>Michael.</p>]]></content:encoded>
    </item>
    <item>
      <title>Disaster Recovery Site and Active Directory (Part 2 of 3)</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/disaster-recovery-site-and-active-directory-part-2-of-3</link>
      <pubDate>Sun, 04 Dec 2011 09:15:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/12/04/disaster-recovery-site-and-active-directory-part-2-of-3/</guid>
      <description><![CDATA[So in Part 2 of the series we're going to discuss the following scenario:    The challenge in this...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana" face="Verdana">So in Part 2 of the series we're going to discuss the following scenario:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3872.image_2D97A73D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3872.image_5F00_2D97A73D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/3302.image_thumb_24B77924.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3302.image_5F00_thumb_5F00_24B77924.png" width="1036" height="619" /></a></p>  <p><span style="font-family: verdana" face="Verdana">The challenge in this scenario is to make the clients in the different Branch sites to failover to their closest Hub sites.</span></p>  <p><span style="font-family: verdana" face="Verdana">It's obvious that HUB is the best option for failover from Branch when the DC in branch (Child-DC03) fails, and HUB2 is the best option for Branch2 when the DC in Branch2 (Child-DC04) fails.</span></p>  <p><span style="font-family: verdana" face="Verdana">The problem is, as we learned in the previous post (<a title="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/01/disaster-recovery-site-and-active-directory-part-1.aspx" href="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/01/disaster-recovery-site-and-active-directory-part-1.aspx">https://blogs.technet.com/b/isrpfeplat/archive/2011/12/01/disaster-recovery-site-and-active-directory-part-1.aspx</a>), that the client doesn't really care about sites and costs, all it cares about is DNS.</span></p>  <p><span style="font-family: verdana" face="Verdana">So in this scenario the client would query the generic list of SRV records for the domain (_ldap._tcp.dc._msdcs.<em>domain.name</em>) and will be able to use any of the DCs.</span></p>  <p><span style="font-family: verdana" face="Verdana"><strong>So why not the DNSAvoidRegisterRecords?</strong></span></p>  <p><span style="font-family: verdana" face="Verdana">The problem is that in this scenario we can remove Child-DC03 (Branch) and Child-DC04 (Branch2) from registering in the DNS by using the DNSAvoidRegisterRecords solution, but… we would still always have Child-DC01 (HUB) and Child-DC2(HUB2) since those are located in HUB sites, and we want the clients to be able to find them no matter what. Plus if I remove them, which one to remove? The DCs in site HUB? That means clients in the Branch site would always login to the DCs in HUB2 and vise versa.</span></p>  <p><span style="font-family: verdana" face="Verdana">So how can we make the client actually figure out the best option for him if the DC in it's own site fails?</span></p>  <p><span style="font-family: verdana" face="Verdana">The solution is…. (drum roll).</span></p>  <p><strong><span style="text-decoration: underline"><span style="font-family: verdana" face="Verdana">Try Next Closest Site Feature </span></span></strong></p>  <p><span style="font-family: verdana" face="Verdana"><strong>Warning: If you're not running 2008 DC/Vista clients or later you can stop reading and use the time to start planning your upgrade… <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="סמיילי" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4382.wlEmoticon-smile_2EF877B7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4382.wlEmoticon_2D00_smile_5F00_2EF877B7.png" /></strong></span></p>  <p><span style="font-family: verdana" face="Verdana">As described here - </span><a title="https://technet.microsoft.com/en-us/library/cc733142(WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc733142(WS.10).aspx"><span style="font-family: verdana" face="Verdana">https://technet.microsoft.com/en-us/library/cc733142(WS.10).aspx</span></a><span style="font-family: verdana" face="Verdana"> </span></p>  <p><span style="font-family: verdana" face="Verdana">The behavior of Try Next Closest Site is:</span></p>  <ul>   <li><span style="font-family: verdana" face="Verdana">Try to find a domain controller in the same site.</span> </li>    <li><span style="font-family: verdana" face="Verdana">If no domain controller is available in the same site, try to find a domain controller in the next closest site. A site is closer if it has a lower site-link cost than another site with a higher site-link cost. </span></li>    <li><span style="font-family: verdana" face="Verdana">If no domain controller is available in the next closest site, try to find any domain controller in the domain. </span></li> </ul>  <p><span style="font-family: verdana" face="Verdana"><strong>Important note: The NextClosestSite feature is redundant to the AutoSiteCoverage feature. If the site where the client is located is Auto Site Covered by DCs in another site the Domain Controllers performing the AutoSiteCoverage are already in the NextClosestSite. </strong></span></p>  <p><span style="font-family: verdana" face="Verdana">So basically what this feature does is enabling the client to use the NextClosestSiteName attribute returned to the DC Locator query being issued by the client:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5875.image_43119440.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5875.image_5F00_43119440.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/5468.image_thumb_2B2AAD1A.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5468.image_5F00_thumb_5F00_2B2AAD1A.png" width="1015" height="543" /></a></p>  <p><span style="font-family: verdana" face="Verdana">As you can see, this example was from a client located in the Branch site, which got the HUB site as it's NextClosestSiteName, the following example is from a client located at the Branch2 site:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2742.image_37A83469.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2742.image_5F00_37A83469.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/0284.image_thumb_1497C2F9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0284.image_5F00_thumb_5F00_1497C2F9.png" width="1035" height="554" /></a></p>  <p><span style="font-family: verdana" face="Verdana">Like we expected – the client located in Branch2 is getting HUB2 as it's NextClosestSiteName.</span></p>  <p><span style="font-family: verdana" face="Verdana">This attribute is returned for every client OS running a version later than 6.0, meaning Vista and later. But… the client will not make any use of this information automatically.</span></p>  <p><span style="font-family: verdana" face="Verdana"><span style="text-decoration: underline"><strong>Enabling the client for Try Next Closest Site</strong></span></span></p>  <p><span style="font-family: verdana" face="Verdana">In order for the client to actually use the information it receives in the NextClosestSiteName attribute we need to enable the usage of Try Next Closest Site in GPO otherwise it would just revert to the default behavior as we saw it Part1, which is to query the list of Generic SRV records for the Domain.</span></p>  <p><span style="font-family: verdana" face="Verdana">If you have DCs Running 2008 or 2008 R2 and clients running Vista or Win7, you can just enable this to be the default behavior for netlogon by using a simple GPO setting.</span></p>  <p><span style="font-family: verdana" face="Verdana">Located under Computer Configuration/Policies/Administrative Templates/System/Netlogon/DC Locator DNS Records. <strong>Try Next Closest Site –&gt; </strong><strong>Enabled</strong>.</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8203.image_7F10E5B4.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8203.image_5F00_7F10E5B4.png"><span style="font-family: verdana" face="Verdana"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/8270.image_thumb_44F1F308.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8270.image_5F00_thumb_5F00_44F1F308.png" width="1026" height="435" /></span></a></p>  <p><span style="font-family: verdana" face="Verdana">This would make the clients looking for DCs always first try to locate a Domain Controller in the nearest site (based on site link costs and topology) prior to failing over to the generic list.</span></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana"><strong><span style="text-decoration: underline">So what actually happens when a DC fails?</span></strong></span></p>  <p><span style="font-family: verdana" face="Verdana">In order to test this behavior let's shut down the AD services on the DC in the client's site (Child-DC01) and perform a secure channel reset (by running nltest /sc_reset:<em>D</em><em>omain.name</em>)</span></p>  <p><span style="font-family: verdana" face="Verdana">After we have enabled this feature in GPO and applied it to our clients the result of this test would be:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5327.image_6C74EE0C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5327.image_5F00_6C74EE0C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/6406.image_thumb_4C1A0BC2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/6406.image_5F00_thumb_5F00_4C1A0BC2.png" width="1183" height="710" /></a></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana">1. The client issues a query to _ldap._tcp.Branch2._sites.dc._msdcs.<em>domain.name </em>(<strong>Frame 203</strong>). Since none of the DCs in the site are available our client will receive the DCs IP address from DNS (<strong>Frame 204</strong>) but will not get a response to the LDAP UDP ping packet sent to the Domain Controller (<strong>Frame 207</strong>)</span></p>  <p><span style="font-family: verdana" face="Verdana">2. The client falls-back to the generic list of Domain Controllers and issues a DNS query to _ldap._tcp.dc_msdcs.<em>domain.name. </em>(<strong>Frame 240</strong>). Recieves the IP addresses of the DCs registered in the Domain's Generic SRV list (<strong>Frame 241</strong>) </span></p>  <p><span style="font-family: verdana" face="Verdana">3.<strong>&#160;</strong>The client sends the UDP LDAP Ping (<strong>Frame 244</strong>) to one of the DCs (in our case Child-dc02) and receives a responses with the Netlogon:LogonSAMLogonResponseEX message containing the NextClosestSiteName (<strong>Frame 247</strong>).</span></p>  <p><span style="font-family: verdana" face="Verdana">3. The client performs a DNS query based on the NextClosestSiteName information – _ldap._tcp.HUB2._sites.dc._msdcs.<em>domain.name</em>. (<strong>Frame 251</strong>) and receives a response containing the DCs in site HUB2 (<strong>Frame 252</strong>).</span></p>  <p><span style="font-family: verdana" face="Verdana">4. The client sends the UDP LDAP ping to a DC in site HUB2 (<strong>Frame 253</strong>). The client has received a valid response from Child-DC02 knowing it's in it's closest site. (<strong>Frame 254</strong>).</span></p>  <p><span style="font-family: verdana" face="Verdana">5. The client performs the secure channel binding (this what I actually requested to do by running nltest /sc_reset) against a DC in the closest site.</span></p>  <p><span style="font-family: verdana" face="Verdana"></span></p>  <p><span style="font-family: verdana" face="Verdana">So by using the Try Next Closest Site feature we have enabled our clients to fail to sites which are the closest to them instead of randomly choosing an available DC in the domain based on the generic SRV record list.</span></p>  <p><span style="font-family: verdana" face="Verdana">That's it for Client logon and failover between sites. In Part 3 we will discuss the Domain Controller replication failover between sites in the different scenarios.</span></p>  <p><span style="font-family: verdana" face="Verdana">Part 3 - <a title="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/11/disaster-recovery-site-and-active-directory-part-3-of-3.aspx" href="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/11/disaster-recovery-site-and-active-directory-part-3-of-3.aspx">https://blogs.technet.com/b/isrpfeplat/archive/2011/12/11/disaster-recovery-site-and-active-directory-part-3-of-3.aspx</a></span></p>  <p><span style="font-family: verdana" face="Verdana">See you soon <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="סמיילי" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4382.wlEmoticon-smile_2EF877B7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4382.wlEmoticon_2D00_smile_5F00_2EF877B7.png" /></span></p>  <p><span style="font-family: verdana" face="Verdana">Michael.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Disaster Recovery Site and Active Directory (Part 1 of 3)</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/disaster-recovery-site-and-active-directory-part-1-of-3</link>
      <pubDate>Thu, 01 Dec 2011 15:29:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/12/01/disaster-recovery-site-and-active-directory-part-1-of-3/</guid>
      <description><![CDATA[Hi All,  Michael here again, and this time I would like to talk a little bit about Active Directory...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana" face="Verdana">Hi All,</span></p>  <p><span style="font-family: verdana" face="Verdana">Michael here again, and this time I would like to talk a little bit about Active Directory replication and Disaster Recovery sites.</span></p>  <p><span style="font-family: verdana" face="Verdana">Since the not so recent events (taking place on 9/11) many companies started to invest time and money in designing and implementing Disaster Recovery solutions which are located at a different physical location in order to provide the organization the option to seamlessly (saying seamlessly after a disaster strikes is kind of bad choice of words, but hey… don't shoot the messenger) failover to that site and keep the business and the organization working.</span></p>  <p><span style="font-family: verdana" face="Verdana">One of the aspects which needs to be considered is the oh so important but often overlooked feature of <strong>client logon</strong>. In the first part of this post we will discuss about how clients logging on to the network are affected by this.</span></p>  <p><span style="font-family: verdana" face="Verdana">In the second part of the post we'll review how to fail-over clients when we have multiple sites with Domain Controllers, and we want the client to failover to the best site possible, and in the third part we'll see </span><span style="font-family: verdana" face="Verdana">the affect it may have on Domain Controller replication in the organization, and how to properly configure and test the failover scenarios. </span></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana"><strong>Client logon scenario:</strong></span></p>  <p><span style="font-family: verdana" face="Verdana">In our sample organization we have a hub site and a DR site both of which contain Domain Controllers. In addition we have several branch sites which don't contain any DCs and rely on the Automatic Site Coverage feature to provide the closest DC for authentication to clients. (More information on the Automatic Site Coverage can be found here - <a title="https://technet.microsoft.com/en-us/library/cc978016.aspx" href="https://technet.microsoft.com/en-us/library/cc978016.aspx">https://technet.microsoft.com/en-us/library/cc978016.aspx</a>)</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/7827.image_61934481.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7827.image_5F00_61934481.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/0574.image_thumb_67AA6B4F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0574.image_5F00_thumb_5F00_67AA6B4F.png" width="666" height="465" /></a></p>  <p><span style="font-family: verdana" face="Verdana">In this scenario the <strong>required</strong> behavior (and please note I say the <strong>required </strong>behavior and not <strong>expected</strong> behavior – that will be explained later) is for clients to authenticate to the Domain Controllers in the DR site in case the Domain Controllers in the Hub site have failed (or the site link from a specific Branch to the Hub site has failed).</span></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana">So, we have clients located at a branch site relying on the Automatic Site Coverage feature of the Domain Controllers in order to find the closest DC.</span></p>  <p><span style="font-family: verdana" face="Verdana">In reality this would look similar to this:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5758.image_6448D3A7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5758.image_5F00_6448D3A7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/4834.image_thumb_21F5BB64.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4834.image_5F00_thumb_5F00_21F5BB64.png" width="846" height="404" /></a></p>  <p><span style="font-family: verdana" face="Verdana">Child-DC01 (located in the HUB site) is performing Automatic Site Coverage for Branch and Branch2 sites) while Child-DC02 which is located in the DR does not. </span></p>  <p><em><span style="font-family: verdana" face="Verdana">(Note: More information on the Automatic Site Coverage may be found here - </span></em><a title="https://technet.microsoft.com/en-us/library/cc978016.aspx" href="https://technet.microsoft.com/en-us/library/cc978016.aspx"><em><span style="font-family: verdana" face="Verdana">https://technet.microsoft.com/en-us/library/cc978016.aspx</span></em></a><em><span style="font-family: verdana" face="Verdana">)</span></em></p>  <p><span style="font-family: verdana" face="Verdana">Now comes the interesting part… </span></p>  <p><strong><span style="text-decoration: underline"><span style="font-family: verdana" face="Verdana">What happens when Child-DC01 fails? </span></span></strong></p>  <p><span style="font-family: verdana" face="Verdana">So based on this </span><a title="https://support.microsoft.com/kb/314861" href="https://support.microsoft.com/kb/314861"><span style="font-family: verdana" face="Verdana">https://support.microsoft.com/kb/314861</span></a><span style="font-family: verdana" face="Verdana"> (and this </span><a title="https://technet.microsoft.com/en-us/library/cc759550(WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc759550(WS.10).aspx"><span style="font-family: verdana" face="Verdana">https://technet.microsoft.com/en-us/library/cc759550(WS.10).aspx</span></a><span style="font-family: verdana" face="Verdana">) the client would then fall-back to the generic list of all Domain Controllers in the domain:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4341.image_657D46B9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4341.image_5F00_657D46B9.png"><span style="font-family: verdana" face="Verdana"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/6813.image_thumb_1800A42C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/6813.image_5F00_thumb_5F00_1800A42C.png" width="865" height="443" /></span></a></p>  <p><span style="font-family: verdana" face="Verdana">So in our &quot;simple&quot; scenario (And I say simple cause there's more it in a second <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="סמיילי" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8154.wlEmoticon-smile_66B1B9CB.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8154.wlEmoticon_2D00_smile_5F00_66B1B9CB.png" />) the client would failover to that list and will successfully find a Domain Controller in the domain. Now since the only option left available is the DC in the DR site - Child-DC02 we're good!</span></p>  <p><span style="font-family: verdana" face="Verdana">Now, you remember (well, it's just in the line above, if you don't then you have more serious things to worry about than this post… ) me saying there's more?? </span></p>  <p><span style="font-family: verdana" face="Verdana">So here's more:</span></p>  <p><strong><span style="font-family: verdana" face="Verdana">How do I make a domain controller failover to that DR site if I have a 3rd DC in another site?</span></strong></p>  <p><span style="font-family: verdana" face="Verdana">So in this scenario we would have a Branch site, just as with the previous example – getting Auto site covered by the DC in the HUB site, but we also have a second Branch site, called Branch2 which <strong>does</strong> contain a DC (child-dc03) and the DRP site which contains child-dc02:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/7450.image_2CC276DF.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7450.image_5F00_2CC276DF.png"><span style="font-family: verdana" face="Verdana"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/4338.image_thumb_4EEA5C98.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4338.image_5F00_thumb_5F00_4EEA5C98.png" width="693" height="647" /></span></a></p>  <p><span style="font-family: verdana" face="Verdana">So in this scenario we need to consider costs. So considering BASL (Bridge All Site Links) is enabled – meaning all site links are transitive the following is the list of costs from the perspective of the branch site:</span></p>  <p><span style="font-family: verdana" face="Verdana">Branch –&gt; Hub = 100</span></p>  <p><span style="font-family: verdana" face="Verdana">Branch –&gt;&#160; DRP = 110&#160; This is because the site links are transitive and we combine the cost of Branch-&gt; Hub and Hub-&gt; DRP(100 + 10).</span></p>  <p><span style="font-family: verdana" face="Verdana">Branch –&gt; Branch2 = 200 (Branch-&gt; Hub and Hub-&gt; Branch2 = 100+100).</span></p>  <p><span style="font-family: verdana" face="Verdana">So obviously we would prefer to go where it's cheaper (which eventually translate to WAN link bandwidth, latency and other decisions affecting cost selection).</span></p>  <p><span style="font-family: verdana" face="Verdana">But, based on what we have experienced previously the client would get all DCs from the DNS query, <strong>including child-dc03</strong> to which we don't want the client to go.</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/7446.image_2A955249.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/7446.image_5F00_2A955249.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/3833.image_thumb_3A54E74D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3833.image_5F00_thumb_5F00_3A54E74D.png" width="816" height="278" /></a></p>  <p><span style="font-family: verdana" face="Verdana">Looking at a netmon trace the DNS result would be similar to:</span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1273.image_10253965.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1273.image_5F00_10253965.png"><span style="font-family: verdana" face="Verdana"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/3005.image_thumb_29ACC692.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3005.image_5F00_thumb_5F00_29ACC692.png" width="796" height="294" /></span></a></p>  <p><span style="font-family: verdana" face="Verdana">This is the default netlogon DC locator behavior. If the DC in my client site (and DCs which Auto Site Cover are considered to be in my site) fail then we fallback to query the generic list of DCs for the domain (_ldap._tcp.dc._msdcs.<em>domain.name</em>)</span></p>  <p><span style="font-family: verdana" face="Verdana">So in order to resolve this situation we have the long ago mentioned solutions:</span></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana"><strong><span style="text-decoration: underline">DnsAvoidRegisterRecords</span></strong></span></p>  <p><span style="font-family: verdana" face="Verdana">As explained in the Branch Offices Guide (<a title="https://technet.microsoft.com/en-us/library/cc749944.aspx" href="https://technet.microsoft.com/en-us/library/cc749944.aspx">https://technet.microsoft.com/en-us/library/cc749944.aspx</a>) we can prevent the domain controllers at the branch site from registering the generic SRV records.</span></p>  <p><span style="font-family: verdana" face="Verdana">The recommended configuration in a branch office deployment is as follows:</span></p>  <ul>   <li>     <p><span style="font-family: verdana" face="Verdana">On all branch office domain controllers, add all entries that do not have &quot;AtSite&quot; as part of the mnemonic, to the value of the registry key, except the DsaCname.</span></p>   </li> </ul>  <p><span style="font-family: verdana" face="Verdana">On hub domain controllers, do not use the registry key. This allows the domain controller to register all records.</span></p>  <p><span style="font-family: verdana" face="Verdana">Creating the registry key on the branch DC (child-dc03) with the value of:</span></p>  <p><span style="font-family: verdana" face="Verdana"><em>Dc        <br />Gc         <br />Kdc         <br />LDAP         <br />Rfc1510Kdc         <br />Rfc1510UdpKdc         <br />Rfc1510Kpwd         <br />Rfc1510UdpKpwd</em></span></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/6204.image_47933EC5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/6204.image_5F00_47933EC5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/5224.image_thumb_32C14645.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5224.image_5F00_thumb_5F00_32C14645.png" width="651" height="524" /></a></p>  <p><span style="font-family: verdana" face="Verdana">Would result in having only the Hub and DR DCs (child-dc01 and child-dc02) listed in the generic list of Domain Controllers for the domain:</span></p>  <p><a><span style="font-family: verdana" face="Verdana"></span></a><span style="font-family: verdana" face="Verdana"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4213.image_6731F2C0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4213.image_5F00_6731F2C0.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" 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/85/03/metablogapi/6675.image_thumb_3DDAAAC2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/6675.image_5F00_thumb_5F00_3DDAAAC2.png" width="865" height="443" /></a></span></p>  <p><span style="font-family: verdana" face="Verdana">Which leaves the client with only one option if the Hub site DCs fail… the DR site DCs.</span></p>  <p>&#160;</p>  <p><span style="font-family: verdana" face="Verdana">That's it for Part 1. </span><span style="font-family: verdana" face="Verdana">In Part 2 we'll talk about failover scenarios for client sites which DO contain Domain Controllers, but those have failed.</span></p>  <p><span style="font-family: verdana" face="Verdana"></span><span style="font-family: verdana" face="Verdana">Part 2 - <a title="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/04/disaster-recovery-site-and-active-directory-part-2-of-3.aspx" href="https://blogs.technet.com/b/isrpfeplat/archive/2011/12/04/disaster-recovery-site-and-active-directory-part-2-of-3.aspx">https://blogs.technet.com/b/isrpfeplat/archive/2011/12/04/disaster-recovery-site-and-active-directory-part-2-of-3.aspx</a></span></p>  <p><span style="font-family: verdana" face="Verdana"></span></p>  <p><span style="font-family: verdana" face="Verdana">Michael.</span></p>  <p><span style="font-family: verdana" face="Verdana">&#160;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Authenticode, signing, VSTOs and what they have to do with CRLs</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/authenticode-signing-vstos-and-what-they-have-to-do-with-crls</link>
      <pubDate>Sun, 06 Nov 2011 05:10:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/11/06/authenticode-signing-vstos-and-what-they-have-to-do-with-crls/</guid>
      <description><![CDATA[The topic of this post may sound a bit strange with many big words, but the reason of the topic is...]]></description>
      <content:encoded><![CDATA[<p>The topic of this post may sound a bit strange with many big words, but the reason of the topic is one..</p>
<p>One picture is worth a thousand words, so what I&rsquo;m trying to explain is this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3617.image_66798098.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3617.image_5F00_66798098.png"><img style="display: inline; border-width: 0px;" title="image" 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/85/03/metablogapi/5355.image_thumb_1BC292FE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5355.image_5F00_thumb_5F00_1BC292FE.png" width="454" height="235" /></a></p>
<p>&nbsp;</p>
<p>Unknown publisher?? I can&rsquo;t install it for users, I want to deploy it silently&hellip;</p>
<p>&nbsp;</p>
<p>Scenario #2 -</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2703.image_1860FB56.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2703.image_5F00_1860FB56.png"><img style="display: inline; border-width: 0px;" title="image" 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/85/03/metablogapi/2605.image_thumb_6A933290.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2605.image_5F00_thumb_5F00_6A933290.png" width="525" height="254" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2742.image_11CE07DA.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2742.image_5F00_11CE07DA.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/8182.image_thumb_3612EC5C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8182.image_5F00_thumb_5F00_3612EC5C.png" width="337" height="194" /></a></p>
<p>While browsing to a website you&rsquo;re getting the UAC prompt (or not able to install) an ActiveX object.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>So let&rsquo;s start with the basics &ndash; Authenticode certificate. What is it?</strong></span></p>
<p>There are two issues that must be addressed to make the Internet a reliable source for software:</p>
<p>Ensuring authenticity - Assures users that they know where the code came from.</p>
<p>Ensuring integrity - Verifies that the code hasn't been tampered with since its publication.</p>
<p>Microsoft's solution to these issues is Microsoft Authenticode coupled with an infrastructure of trusted entities. Authenticode, which is based on industry standards, allows developers to include information about themselves and their code with their programs through the use of digital signatures.</p>
<p>While Authenticode itself cannot guarantee that signed code is safe to run, Authenticode is the mechanism by which users can be informed of whether the software publisher is participating in the infrastructure of trusted entities. Thus, Authenticode serves the needs of both software publishers and users who rely upon the Internet for the downloading of software.</p>
<p>In simple words Authenticode is a technology used by developers to sign their applications in order to notify end users that it was written by them. In here comes the whole idea of certificates, trusted authorities etc' which eventually gets utilized in order to make sure the signer is indeed a valid company (For example a certificate issued for the name Microsoft issued by VeriSign does insure it is indeed Microsoft, while a certificate issued for the name Microsoft issued by MyHomeCA doesn't really ensure the code was written by Microsoft.. does it?).</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">How does the certificate looks like?</span></strong></p>
<p>Basically the certificate in question is a code signing certificate and is used for "Ensures software came from software publisher" and "Protects software from alteration after publication". As it says in the certificate usage policies:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/4375.image_413BEA92.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4375.image_5F00_413BEA92.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/8407.image_thumb_581ABC0E.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8407.image_5F00_thumb_5F00_581ABC0E.png" width="290" height="358" /></a></p>
<p>That's the certificate used to sign the ActiveX or the VSTO control we have showed in the previous pictures.</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Signed vs. Non-signed</span></strong></p>
<p>So why do we need this certificate?</p>
<p>Well, let's look at IE behavior trying to install a signed ActiveX and an unsigned ActiveX:</p>
<p>The IE page references the cab file using the following code:</p>
<div id="codeSnippetWrapper">
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;" id="codeSnippet"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">object</span> <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="secondobj"</span> <span style="color: #ff0000;">style</span><span style="color: #0000ff;">='display:none'</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">='TestActivex'</span>  <br />  <span style="color: #ff0000;">classid</span><span style="color: #0000ff;">='CLSID:A47C22B1-3CC3-45bc-801E-3FCC4FFD3E45'</span> <br />  <span style="color: #ff0000;">codebase</span><span style="color: #0000ff;">='/TestApp/mycab.cab#version=-1,-1,-1,-1'</span><span style="color: #0000ff;">&gt;&lt;/</span><span style="color: #800000;">object</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
<p>Now if mycab.cab is not signed using the Authenticode certificate the page received is:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8081.image_5525575B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8081.image_5F00_5525575B.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/4375.image_thumb_30D04D0C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4375.image_5F00_thumb_5F00_30D04D0C.png" width="420" height="177" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5074.image_77CA21EA.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5074.image_5F00_77CA21EA.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/3324.image_thumb_6AEFCBCC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3324.image_5F00_thumb_5F00_6AEFCBCC.png" width="356" height="205" /></a></p>
<p>User Account Control prompt stating the publisher is unknown. This may lead to the user declining the installation of the ActiveX component and the inability to silently install the component by using the ActiveX installer service.</p>
<p>As so clearly mentioned in the ActiveX installer service description - <strong>"Silent installation for unsigned controls is not supported"</strong></p>
<p></p>
<p>On the other hand, if the mycab.cab file is signed the screen we'll see is:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2112.image_2389C3F9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2112.image_5F00_2389C3F9.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/8078.image_thumb_7F34B9A9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8078.image_5F00_thumb_5F00_7F34B9A9.png" width="427" height="201" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3821.image_419883CE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3821.image_5F00_419883CE.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/1261.image_thumb_71DF5884.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1261.image_5F00_thumb_5F00_71DF5884.png" width="365" height="210" /></a></p>
<p>Which looks much friendlier, and now that we trust the publisher it means we can use ActiveX installer service to silently install it.</p>
<p>&nbsp;</p>
<p>But that's not the end of it.</p>
<p>Sometimes I may still receive the "unsigned" UAC prompt, although the ActiveX is properly signed. So why is that?</p>
<p><strong><span style="text-decoration: underline;">Windows WinTrust setting:</span></strong></p>
<p>The WinTrust feature in windows is basically a group of code-signing and certificate management tools which applications can access in order to check for information.</p>
<p>This way Internet Explorer access the WinTrust APIs (thoroughly documented on MSDN) to verify whether we trust the certificate which used to sign the ActiveX or not.</p>
<p>The WinTrust itself has a registry setting which controls which certificates do we trust. This key is located under <em>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing\</em> and the Value is <em>State</em> (DWORD).</p>
<p>The <em>State </em>value is a hexa-decimal flag which may represent a combination of any of the following flags:</p>
<p>WTPF_TRUSTTEST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000020 <br />WTPF_TESTCANBEVALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000080 <br />WTPF_IGNOREEXPIRATION&nbsp;&nbsp;&nbsp;&nbsp; 0x00000100 <br />WTPF_IGNOREREVOKATION&nbsp;&nbsp;&nbsp;&nbsp; 0x00000200 <br />WTPF_OFFLINEOK_IND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000400 <br />WTPF_OFFLINEOK_COM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000800 <br />WTPF_OFFLINEOKNBU_IND&nbsp;&nbsp;&nbsp;&nbsp; 0x00001000 <br />WTPF_OFFLINEOKNBU_COM&nbsp;&nbsp;&nbsp;&nbsp; 0x00002000 <br />WTPF_VERIFY_V1_OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00010000 <br />WTPF_IGNOREREVOCATIONONTS 0x00020000 <br />WTPF_ALLOWONLYPERTRUST&nbsp;&nbsp;&nbsp; 0x00040000</p>
<p>An explanation can be found at <a title="https://msdn.microsoft.com/en-us/library/aa388197(v=VS.85).aspx" href="https://msdn.microsoft.com/en-us/library/aa388197(v=VS.85).aspx">https://msdn.microsoft.com/en-us/library/aa388197(v=VS.85).aspx</a></p>
<p>So since the default setting of this value is 23c00 which means:</p>
<p>WTPF_OFFLINEOK_IND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000400 <br />WTPF_OFFLINEOK_COM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000800 <br />WTPF_OFFLINEOKNBU_IND&nbsp;&nbsp;&nbsp;&nbsp; 0x00001000 <br />WTPF_OFFLINEOKNBU_COM&nbsp;&nbsp;&nbsp;&nbsp; 0x00002000 <br />WTPF_IGNOREREVOCATIONONTS 0x00020000</p>
<p>We'll be checking the Certificate Revocation List, which in turn, if not accessible will revert to the state that we do not the certificate used to sign the code (because we can't verify whether it's still a valid certificate if we can't access the CRLs).</p>
<p>&nbsp;</p>
<p>This registry key is controller by an IE setting as well:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/2318.image_5649A4A0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/2318.image_5F00_5649A4A0.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/1638.image_thumb_131E2673.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1638.image_5F00_thumb_5F00_131E2673.png" width="281" height="359" /></a></p>
<p>Unchecking the "Check for publisher's certificate revocation" will modify the State registry to a value of 23e00 which is:</p>
<p><strong>WTPF_IGNOREREVOKATION&nbsp;&nbsp;&nbsp;&nbsp; 0x00000200 &ndash; </strong>This flag is added. <br />WTPF_OFFLINEOK_IND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000400 <br />WTPF_OFFLINEOK_COM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000800 <br />WTPF_OFFLINEOKNBU_IND&nbsp;&nbsp;&nbsp;&nbsp; 0x00001000 <br />WTPF_OFFLINEOKNBU_COM&nbsp;&nbsp;&nbsp;&nbsp; 0x00002000 <br />WTPF_IGNOREREVOCATIONONTS 0x00020000</p>
<p>So having a valid certificate without the ability to verify it's CRLs is the same as having an invalid certificate!</p>
<p><span style="text-decoration: underline;"><strong>What's there to do with ActiveX's?</strong></span></p>
<p>As always that depends:</p>
<p>Talking about production environments &ndash; you would need to troubleshoot the reason why the authenticode checks performed by WinTrust are failing and the ActiveX is not treated as signed by a trusted publisher.</p>
<p>Another option you may have is reducing the requirements which are used by WinTrust in order to verify the certificate.</p>
<p><strong>Important: This option is only valid for test environments, reducing the WinTrust requirements will have a huge impact on your organizations security!</strong></p>
<p>&nbsp;</p>
<p>After you have verified your ActiveX is properly signed you can use the ActiveX installer policy to silently install the ActiveX for your organizations website:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/6567.image21_2462B5F7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/6567.image21_5F00_2462B5F7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/4010.image21_thumb_28205AC7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4010.image21_5F00_thumb_5F00_28205AC7.png" width="486" height="446" /></a></p>
<p>(You can find that under Group Policy &ndash;&gt; Machine settings &ndash;&gt; Administrative Templates &ndash;&gt; Windows Components &ndash;&gt; ActiveX Installer Service)</p>
<p><strong><span style="text-decoration: underline;">Talking about VSTO</span></strong></p>
<p>When discussing Authenticode in regards to VSTO we'll be using the same WinTrust functionality as we did with IE ActiveX installation with one small difference. Since VSTO is .NET application we're also relying on the .NET trust manager feature.</p>
<p>So trying to install an un-signed VSTO in our case resulted in the following:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1106.image25_5BB8A158.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1106.image25_5F00_5BB8A158.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/8055.image25_thumb_60BADF07.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8055.image25_5F00_thumb_5F00_60BADF07.png" width="504" height="250" /></a></p>
<p>Which makes sense.</p>
<p>Now &ndash; just as with Internet Explorer, if the VSTO is signed, but we weren't able to verify CRLs (and we were required based on the WinTrust policy) we will receive the same error message.</p>
<p>The .NET specific requirements for&nbsp; signing are required under the following key:</p>
<p><em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Security\TrustManager\PromptingLevel</em></p>
<p>Looking at our specific setting we noted that we have <em>MyComputer </em>set to a value of <em>AuthenticodeRequired </em>(REG_SZ)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1108.image33_47FB91F7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1108.image33_5F00_47FB91F7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/5811.image33_thumb_18E93053.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5811.image33_5F00_thumb_5F00_18E93053.png" width="594" height="445" /></a></p>
<p>Which (by using common sense) requires an assembly to pass the Authenticode requirements (defined by WinTrust) in order to be installed from the MyComputer zone.</p>
<p>This is called the Inclusion List (more information can be found at <a title="https://msdn.microsoft.com/en-us/library/bb772070.aspx" href="https://msdn.microsoft.com/en-us/library/bb772070.aspx">https://msdn.microsoft.com/en-us/library/bb772070.aspx</a>).</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>So what's there to do with VSTO?</strong></span></p>
<p>Well, the first and best option is to identify why our certificate is not passing the WinTrust requirements.</p>
<p>We can get information about the certificate used to sign the VSTO&nbsp; manifest by just opening the manifest by using notepad and we'll be able to identify the certificate which was used in order to sign the VSTO. In our case the certificate was issued to <em>&lt;publisherIdentity name="CN=Michael Dubinsky, OU=Accounts, DC=w2k8r2, DC=local" issuerKeyHash="a8c0a14c4d0c3a2fc0a17c0439d4166baa3e44cf" /&gt;.</em></p>
<p>You can also use the certutil &ndash;verify option. More information on that is available at <a title="https://blogs.technet.com/b/pki/archive/2006/11/30/basic-crl-checking-with-certutil.aspx" href="https://blogs.technet.com/b/pki/archive/2006/11/30/basic-crl-checking-with-certutil.aspx">https://blogs.technet.com/b/pki/archive/2006/11/30/basic-crl-checking-with-certutil.aspx</a></p>
<p>By using this information we'll be able to see if the certificate is in our Trusted Publisher store, and whether it corresponds to all the requirements as required by WinTrust.</p>
<p>Another option would be to modify the Inclusion List policy (in this example I could set the Inclusion list for MyComputer Zone to Enabled).</p>
<p>Or, after looking at the certificate I have noted that I wasn't trusting the Certificate Authority which has generated the Trusted Publisher certificate (w2k8r2-W2K8R2DC01-CA).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5315.image37_7FBDB04D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5315.image37_5F00_7FBDB04D.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" 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/85/03/metablogapi/8547.image37_thumb_6AEBB7CD.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8547.image37_5F00_thumb_5F00_6AEBB7CD.png" width="313" height="389" /></a></p>
<p>&nbsp;</p>
<p>Adding this CA to the Trusted Root Certificate Authorities has resolved the issue and I was able to silently install.</p>
<p>&nbsp;</p>
<p>That's the story of Authenticode and digital signing.</p>
<p>Hopefully that would make some compatibility issues more understandable and easier to resolve.</p>
<p>Until next time,</p>
<p>Michael.</p>]]></content:encoded>
    </item>
    <item>
      <title>And sometimes the GUI does not tell you the whole story</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/and-sometimes-the-gui-does-not-tell-you-the-whole-story</link>
      <pubDate>Mon, 26 Sep 2011 11:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Moti Bani]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/09/26/and-sometimes-the-gui-does-not-tell-you-the-whole-story/</guid>
      <description><![CDATA[Hi All,
Hello world! This is Moti. Just as Michael and Guy, I am a member of the Israel PFE team,...]]></description>
      <content:encoded><![CDATA[<p>Hi All,</p>
<p>Hello world! This is Moti. Just as Michael and Guy, I am a member of the Israel PFE team, specializing in Performance/Internals, Remote Desktop and Failover Clustering.</p>
<p>I have been working recently on a case and came across an interesting performance behavior of SQL server installed with SCCM server. It appeared that the server (with 12 GB of RAM) was short on available memory, despite the fact that it was idle most of the time.</p>
<p>I used <a href="https://technet.microsoft.com/en-us/sysinternals/ff700229">RAMMAP</a> from Sysinternals, advanced physical memory usage analysis utility, and found out the largest block of memory was AWE. AWE allows a 32-bit software to manipulate physical memory greater than 4GB, and is used mostly by database applications, like SQL server.</p>
<p>But this is a x64 server! There is no need for AWE. So I checked SQL server memory properties and noticed that &ldquo;use AWE&rdquo; was not selected.</p>
<p>I launched WinDbg as kernel-mode debugger and checked if sqlserver.exe is indeed using AWE by using this command: <b><i>dt NT!_EPROCESS &lt;address of sqlserver.exe&gt; AweInfo</i></b>. If the process is not using AWE this values should be NULL, but I found a value. Another test was stopping SQL server service, and the result in RAMMAP showed that AWE is empty when SQL server was stopped, and AWE section was growing fast when the SQL server service was started.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1524.clip_image002_48BC6D85.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1524.clip_5F00_image002_5F00_48BC6D85.jpg"><img style="border: 0px currentColor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1121.clip_image002_thumb_7BE88121.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1121.clip_5F00_image002_5F00_thumb_5F00_7BE88121.jpg" width="198" height="244" /></a></p>
<p>OK, so we have found the culprit, but why is the SQL server using AWE ? It turns out that when you select the option to &ldquo;lock pages in memory&rdquo; on x64 bit systems, SQL Server will use AWE API calls that are more efficient for memory allocations than the standard API memory allocation calls.</p>
<p>Proof that the GUI sometimes tells you just a part of the story ;)</p>
<p>Moti</p>]]></content:encoded>
    </item>
    <item>
      <title>A case of a disappeared schema attribute or schema limbo in progress</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/a-case-of-a-disappeared-schema-attribute-or-schema-limbo-in-progress</link>
      <pubDate>Mon, 19 Sep 2011 16:01:00 GMT</pubDate>
      <dc:creator><![CDATA[GuyTe]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/09/19/a-case-of-a-disappeared-schema-attribute-or-schema-limbo-in-progress/</guid>
      <description><![CDATA[Disclaimer: Do NOT in any way attempt to perform the steps outlined in this post in your production...]]></description>
      <content:encoded><![CDATA[<p><strong><span style="color: #ff0000; font-size: small;" size="3" color="#ff0000">Disclaimer: Do NOT in any way attempt to perform the steps outlined in this post in your production environment. If you do this, things will break. Take my word on it !</span></strong></p>
<p>Disappeared attribute ? How that can happen ? I mean, either the attribute is in the schema or not, and there is no way to delete something from schema. The only option available to prevent attribute from being used is to <a href="https://technet.microsoft.com/en-us/library/cc961741.aspx">defunct it</a>, effectively making it impossible to use the attribute. The only way to do that, that I was aware till now, was to set isDefunct attribute of the schema object to True (given that it is not used by another active schema object), but you live and learn and sometimes your assumptions turn out to be not quite correct. Here is a story of a case I was involved in, where we had a customer loosing an attribute without setting its isDefunct to True.</p>
<p>Customer was trying to make user pictures available in the GAL using the <a href="https://blogs.technet.com/b/exchange/archive/2010/03/10/gal-photos-in-exchange-2010-and-outlook-2010.aspx">instructions in the following blog post</a>. The only caveat was that the customer did not run forestprep to extend the AD schema to W2K8 or W2K8 R2 version, which is a requirement for the Picture attribute to become available in the GAL. If you do some research, you will actually find that W2K8 schema extension has the following in Sch40.ldf file:</p>
<div id="codeSnippetWrapper">
<div style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;" id="codeSnippet">
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060;" id="lnum1"> 1:</span> dn: CN=Picture,CN=Schema,CN=Configuration,DC=X</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060;" id="lnum2"> 2:</span> changetype: ntdsSchemaModify</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060;" id="lnum3"> 3:</span> replace: mapiId</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060;" id="lnum4"> 4:</span> mapiId: 35998</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060;" id="lnum5"> 5:</span> -</pre>
<!--CRLF--></div>
</div>
<p>What this particular part does is to set the mapiId attribute of Picture classSchema object in the Schema to the value of 35998.</p>
<p>&ldquo;Well, if that is the only requirement needed for the change, why do I need to run the forestprep ?&rdquo; &ndash; the customer asked himself and started looking for ways to perform this single change without rolling out fully blown W2K8/R2 schema extension. Now that IS dangerous, as we are dealing here with the base schema, which is expected to be modified only by controlled procedures and tools shipped by the base AD schema owner (read: &ldquo;forestprep by Microsoft&rdquo;) and if you change something, forestprep comes in later and overrides whatever you changed and you loose data or functionality, you will find yourself in the position where you can blame only yourself. Right&hellip; We warned you. Remember all those disclaimers that things might break ? Well, this is how that can happen.</p>
<table style="width: 808px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="806">
<p><strong>What are the base Schema objects (aka Category 1 classes and attributes) ?</strong></p>
<p>From <a title="https://technet.microsoft.com/en-us/magazine/2008.05.schema.aspx" href="https://technet.microsoft.com/en-us/magazine/2008.05.schema.aspx">https://technet.microsoft.com/en-us/magazine/2008.05.schema.aspx</a>:</p>
<p><em>The core schema provides definitions for many well-known classes (such as user, computer, and organizationalUnit) and attributes (such as telephoneNumber and objectSID). The objects present in the core schema definition are known as Category 1 objects, and objects that are added are called Category 2 objects. <br /> <br /></em></p>
<hr /><strong>Are there any restrictions imposed on Category 1 schema objects ?</strong>
<p>From <a title="https://msdn.microsoft.com/en-us/library/ms677924(VS.85).aspx" href="https://msdn.microsoft.com/en-us/library/ms677924(VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms677924(VS.85).aspx</a>:</p>
<ul>
<li>
<p><em>You cannot change the following attributes of a Category 1 attribute: </em></p>
<ul>
<li><em><strong>rangeLower</strong> and <strong>rangeUpper</strong> (value range). </em></li>
<li><em><strong>attributeSecurityGuid</strong> (determines which property set the attribute belongs in, if any).</em></li>
</ul>
</li>
<li><em>You cannot change the <strong>defaultObjectCategory</strong> of a Category 1 class. </em></li>
<li><em>You cannot change the <strong>objectCategory</strong> of any instance of a Category 1 class. </em></li>
<li><em>You cannot make a Category 1 class or attribute defunct. </em></li>
<li><em>You cannot change the <strong>lDAPDisplayName</strong> of a Category 1 class or attribute. </em></li>
<li><em>You cannot rename a Category 1 class or attribute.</em></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>At that point the customer decides that he manually edits the schema (should I repeat myself and remind that editing base schema objects is a bad idea ?) and tries to edit the &ldquo;CN=Picture,CN=Schema,CN=Configuration,DC=X&rdquo; attributeSchema object and set mapiId attribute to 35998, but is faced with a nice dialog from ADSIEDIT that informs that the attribute is owned by System and can not be edited:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/1768.image_286B870D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/1768.image_5F00_286B870D.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/8540.image_thumb_2AC5090B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/8540.image_5F00_thumb_5F00_2AC5090B.png" width="406" height="121" /></a></p>
<p>Remember those Category 1 schema objects ? Well, thumbnailPhoto (aka Picture) attribute is Category 1 schema object:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/0714.image_3E71F29F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0714.image_5F00_3E71F29F.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/0310.image_thumb_03AA49C9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0310.image_5F00_thumb_5F00_03AA49C9.png" width="408" height="453" /></a></p>
<p>But that does not scare our customer and he digs the net and discovers the &ldquo;s c h e m a U p g r a d e I n P r o g r e s s&rdquo; trick (the spaces are intentional. Just another step to make it harder for people to shoot themselves in the foot)&hellip; Now let me tell you something about that functionality: <strong>You should never ever use it</strong>. It is dangerous as it relaxes a number of restrictions and consistency checks that are performed during schema modifications. If you come to a conclusion that this is your only option, do yourself a favor and open a support incident with our customer support, or else, you might get into the situation where your only option would be a full forest recovery. Let me repeat myself:<em><span style="color: #ff0000;" color="#ff0000"> <strong>FULL FOREST RECOVERY</strong></span></em>.</p>
<p>And this is where things went wrong&hellip; Customer used the above mentioned trick and accidentally set mapiID attribute to 35998 on 2 objects:</p>
<ul>
<li>CN=Picture</li>
<li>CN=MAPI-ID</li>
</ul>
<p>See the irony ? MAPI-ID attributeSchema object in the schema has an attribute mapiId. So basically the attribute kind of describes itself:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3022.image_61DE7137.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/3022.image_5F00_61DE7137.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" 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/85/03/metablogapi/4024.image_thumb_792975A8.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/4024.image_5F00_thumb_5F00_792975A8.png" width="406" height="453" /></a></p>
<p>Want to guess what happens when two attributes in the schema have the same MapiId ?</p>
<p>Here we go:</p>
<table style="width: 896px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="894">
<p>Event Type:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Warning <br />Event Source:&nbsp;&nbsp;&nbsp; NTDS General <br />Event Category:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DS Schema <br /><span style="color: #ff0000;" color="#ff0000"><strong>Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1853</strong></span> <br />Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1/19/2011 <br />Time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6:44:20 AM <br />User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NT AUTHORITY\ANONYMOUS LOGON <br />Computer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SRVDCHQ01 <br />Description: <br /><span style="color: #ff0000;" color="#ff0000"><strong>The mapiID value for the following attribute duplicates the mapiID value for an existing attribute. <br /></strong></span>&nbsp; <br />Attribute: <br /><strong>thumbnailPhoto</strong> (160023, 160023) <br />Existing attribute: <br /><strong>mAPIID</strong> (20031, 20031) <br />&nbsp; <br /><span style="color: #ff0000;" color="#ff0000"><strong>Both attributes are considered defunct (as if the isDefunct attribute value were TRUE). The condition will resolve itself after the schema directory partition has replicated successfully. <br /></strong></span>&nbsp; <br />User Action <br />If this event continues to occur, initiate a replication cycle with all replication partners of the local domain controller. <span style="color: #ff0000;" color="#ff0000">If the condition persists, deactivate one of the above classes by setting the isDefunct value to TRUE.</span> <br />&nbsp; <br />For more information, see Help and Support Center at <a href="https://go.microsoft.com/fwlink/events.asp">https://go.microsoft.com/fwlink/events.asp</a>.</p>
</td>
</tr>
</tbody>
</table>
<p>Huston, we have a problem ! We have two attributes auto-defuncted because of the MapiID collision. But hey, the event ID is providing us a solution: defunct one of those two attributes and you are done. Well&hellip; there is a catch: you can&rsquo;t defunct an attribute that is used by schema classes and as it happens, this is the case for both attributes in question.</p>
<p>So what are our options ? Well&hellip; roughly we have to perform the following surgery:</p>
<ol>
<li>Identify the attribute that is used less in the schema (we do want to minimize the schema changes)
<ul>
<li>Selecting <strong>thumbnailPhoto</strong> (CN=Picture,CN=Schema,CN=Configuration,DC=X) is quite natural as <strong>MapiID</strong> is used all over the board</li>
</ul>
</li>
<li>Find in what classes the attribute is used and save this information (we will need it later) <br /> <br />
<ul>
<li>To identify the classes you can use the following queries: <br /> <br />
<table style="width: 803px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="801">
<p><span style="font-size: xx-small;" size="1">C:\&gt;dsquery * "cn=schema,cn=configuration,dc=w2k8r2,dc=local" -filter "systemMayContain=2.16.840.1.113730.3.1.35" <br />"CN=Organizational-Person,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local"</span></p>
<p><span style="font-size: xx-small;" size="1">C:\&gt;dsquery * "cn=schema,cn=configuration,dc=w2k8r2,dc=local" -filter "mayContain=2.16.840.1.113730.3.1.35"</span></p>
<p><span style="font-size: xx-small;" size="1">C:\&gt;dsquery * "cn=schema,cn=configuration,dc=w2k8r2,dc=local" -filter "mustContain=2.16.840.1.113730.3.1.35"</span></p>
<p><span style="font-size: xx-small;" size="1">C:\&gt;dsquery * "cn=schema,cn=configuration,dc=w2k8r2,dc=local" -filter "systemMustContain=2.16.840.1.113730.3.1.35"</span></p>
<p><span style="font-size: xx-small;" size="1">C:\&gt;</span></p>
</td>
</tr>
</tbody>
</table>
</li>
<li>As my lab environment has only vanilla W2K8R2 schema, you will notice that only <strong>organizationalPerson</strong> object class is using the <strong>thumbnailPhoto</strong> attribute, but if you run this against a forest with Exchange schema, you will notice that also the <strong>group</strong> object class has thumbnailPhoto in mayContain.</li>
</ul>
</li>
<li>Use the &ldquo;s c h e m a U p g r a d e I n P r o g r e s s&rdquo; trick (instructions NOT included)</li>
<li>Remove the attribute from mayContain/mustContain/systemMayContain/systemMustContain of the classes we found in [2]</li>
<li>Defunct the <strong>thumbnailPhoto</strong> attribute <br /> <br />
<table style="width: 469px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="467">
<p><span style="font-family: Miriam Fixed;" face="Miriam Fixed">dn: CN=Picture,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />replace: isDefunct <br />isDefunct: TRUE <br />-</span></p>
</td>
</tr>
</tbody>
</table>
<br /><strong><span style="text-decoration: underline;"><span style="color: #0000ff;" color="#0000ff">Side note:</span></span></strong> when an attribute is defuncted, the information stored in the attribute is not lost, so if you have already populated thumbnailPhoto attribute, after you bring it back to life, you will have the values back on the objects</li>
<li>Resolve the MapiID conflict by altering the MapiID attribute of MapiID attributeSchema object <br /> <br />
<table style="width: 470px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="468">
<p>dn: CN=MAPI-ID,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />replace: MapIID <br />MapiID: 32974 <br />-</p>
<p>dn: CN=Picture,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />replace: MapIID <br />MapiID: 35998 <br />-</p>
<p>DN: <br />changetype: modify <br />add: schemaUpdateNow <br />schemaUpdateNow: 1 <br />-</p>
</td>
</tr>
</tbody>
</table>
</li>
<li>Un-defunct thumbnailPhoto attribute <br /> <br />
<table style="width: 471px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="469">
<p>dn: CN=Picture,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />replace: isDefunct <br />isDefunct: FALSE <br />-</p>
</td>
</tr>
</tbody>
</table>
&nbsp;&nbsp;</li>
<li>Update the schema cache <br /> <br />
<table style="width: 472px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="470">
<p>DN: <br />changetype: modify <br />add: schemaUpdateNow <br />schemaUpdateNow: 1 <br />-</p>
</td>
</tr>
</tbody>
</table>
</li>
<li>Add thumbnailPhoto attribute back to the classes we removed it from at [3] <br /> <br />
<table style="width: 471px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="469">
<p>dn: CN=Organizational-Person,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />add: systemMayContain <br />systemMayContain: thumbnailPhoto <br />-</p>
<p>dn: CN=Group,CN=Schema,CN=Configuration,DC=X <br />changetype: ntdsSchemaModify <br />add: mayContain <br />mayContain: thumbnailPhoto <br />-</p>
</td>
</tr>
</tbody>
</table>
</li>
<li>Update the schema cache: <br /> <br />
<table style="width: 469px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="467">
<p>DN: <br />changetype: modify <br />add: schemaUpdateNow <br />schemaUpdateNow: 1 <br />-</p>
</td>
</tr>
</tbody>
</table>
</li>
<li>Pray to the schema gods (this part is crucial <img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/0652.wlEmoticon-smile_3FA92FDF.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/0652.wlEmoticon_2D00_smile_5F00_3FA92FDF.png" />)</li>
<li>Verify the results: <br /> <br />
<table style="width: 817px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="815">
<p>Expanding base 'CN=Picture,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local'... <br />Result &lt;0&gt;: (null) <br />Matched DNs: <br />Getting 1 entries: <br />&gt;&gt; Dn: <span style="background-color: #ffff00;">CN=Picture,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local <br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&gt; objectClass: top; attributeSchema; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; cn: Picture; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; distinguishedName: CN=Picture,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; instanceType: 0x4 = ( IT_WRITE ); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; whenCreated: 10/23/2002 03:50:19 Jerusalem Standard Time Jerusalem Daylight Time; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; whenChanged: 01/24/2011 14:52:45 Jerusalem Standard Time Jerusalem Daylight Time; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; uSNCreated: 4876; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; attributeID: 2.16.840.1.113730.3.1.35; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; attributeSyntax: 2.5.5.10; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; isSingleValued: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; rangeLower: 0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; rangeUpper: 102400; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt;<span style="background-color: #ffff00;"> mAPIID: 35998; <br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; uSNChanged: 12157493; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; showInAdvancedViewOnly: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; adminDisplayName: Picture; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; adminDescription: Picture; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; oMSyntax: 4; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; searchFlags: 0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; lDAPDisplayName: thumbnailPhoto; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; name: Picture; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; objectGUID: 85e62def-5ba7-4f4e-9539-64d18246582b; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; schemaIDGUID: 8d3bca50-1d7e-11d0-a081-00aa006c33ed; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; attributeSecurityGUID: 77b5b886-944a-11d1-aebd-0000f80367c1; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; systemOnly: FALSE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; systemFlags: 0x10 = ( FLAG_SCHEMA_BASE_OBJECT ); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; isMemberOfPartialAttributeSet: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; isDefunct: FALSE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; objectCategory: CN=Attribute-Schema,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&gt; dSCorePropagationData: 01/18/2011 18:16:28 Jerusalem Standard Time Jerusalem Daylight Time; 1/1/1601 2:0:1 Jerusalem Standard Time Jerusalem Daylight Time;</p>
<p><br />Expanding base 'CN=Mapi-ID,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local... <br />Result &lt;0&gt;: (null) <br />Matched DNs: <br />Getting 1 entries: <br />&gt;&gt; <span style="background-color: #ffff00;">Dn: CN=Mapi-ID,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local</span> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&gt; objectClass: top; attributeSchema; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; cn: MAPI-ID; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; distinguishedName: CN=MAPI-ID,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; instanceType: 0x4 = ( IT_WRITE ); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; whenCreated: 10/23/2002 03:50:16 Jerusalem Standard Time Jerusalem Daylight Time; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; whenChanged: 01/24/2011 14:52:43 Jerusalem Standard Time Jerusalem Daylight Time; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; uSNCreated: 4461; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; attributeID: 1.2.840.113556.1.2.49; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; attributeSyntax: 2.5.5.9; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; isSingleValued: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; <span style="background-color: #ffff00;">mAPIID: 32974; <br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; uSNChanged: 12157489; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; showInAdvancedViewOnly: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; adminDisplayName: MAPI-ID; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; adminDescription: MAPI-ID; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; oMSyntax: 2; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; searchFlags: 0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; lDAPDisplayName: mAPIID; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; name: MAPI-ID; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; objectGUID: 9cc0d7fa-822a-44e4-a891-eca43c55ddb0; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; schemaFlagsEx: 1; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; schemaIDGUID: bf9679b7-0de6-11d0-a285-00aa003049e2; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; systemOnly: TRUE; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; systemFlags: 0x10 = ( FLAG_SCHEMA_BASE_OBJECT ); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&gt; objectCategory: CN=Attribute-Schema,CN=Schema,CN=Configuration,DC=w2k8r2,DC=local; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&gt; dSCorePropagationData: 01/18/2011 18:16:27 Jerusalem Standard Time Jerusalem Daylight Time; 1/1/1601 2:0:1 Jerusalem Standard Time Jerusalem Daylight Time;</p>
</td>
</tr>
</tbody>
</table>
</li>
<li>Done&hellip;</li>
</ol>
<p>&nbsp;</p>
<p>Bottom line: NEVER EVER perform changes like this directly in the production environment. Test, test, test and it will save you a lot of grief if/when something goes wrong&hellip;</p>
<p>Till next time, <br />GuyTe</p>]]></content:encoded>
    </item>
    <item>
      <title>Debugging DsGetDCName in Win7</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/debugging-dsgetdcname-in-win7</link>
      <pubDate>Wed, 04 May 2011 05:22:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/05/04/debugging-dsgetdcname-in-win7/</guid>
      <description><![CDATA[Hi,
&nbsp;
That's just a short post while I'm working for a longer one.
A couple of days ago I...]]></description>
      <content:encoded><![CDATA[<p>Hi,</p>
<p>&nbsp;</p>
<p>That's just a short post while I'm working for a longer one.</p>
<p>A couple of days ago I was debugging an application, and I wanted to set a breakpoint for the DsGetDCName function to figure out the flags being passed to the function &ndash; (<a href="https://msdn.microsoft.com/en-us/library/ms675983(VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms675983(VS.85).aspx</a>)</p>
<p>and while in the MSDN help in says it's in the netapi32.dll the query in the debugger didn't show it to actually be there:</p>
<p>0:000&gt; bp netapi32!DsGetDCName <br />Couldn't resolve error at 'netapi32!DsGetDCName'</p>
<p>&nbsp;</p>
<p>So after some digging and a lot of step overs eventually I found out that the DsGetDCName function was moved to the logoncli.dll!</p>
<p><strong>So in order to break on the DsGetDCName you need to setup a breakpoint for logoncli!DsGetDCName</strong></p>
<p>0:000&gt; bp logoncli!DsGetDCNameW <br />0:000&gt; bl <br />0 e 73a74ca8&nbsp;&nbsp;&nbsp;&nbsp; 0001 (0001)&nbsp; 0:**** LOGONCLI!DsGetDcNameW</p>
<p><strong>&nbsp;</strong></p>
<p>That's it&hellip; </p>
<p>&nbsp;</p>
<p>Hopefully it will save time for someone in the future <img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5807.wlEmoticon-smile_0C5446EA.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-03-metablogapi/5807.wlEmoticon_2D00_smile_5F00_0C5446EA.png" alt="סמיילי" class="wlEmoticon wlEmoticon-smile" style="border-style: none;" /></p>
<p>&nbsp;</p>
<p>Michael.</p>]]></content:encoded>
    </item>
    <item>
      <title>Querying BITWISE flags in attributes</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/querying-bitwise-flags-in-attributes</link>
      <pubDate>Mon, 17 Jan 2011 08:01:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2011/01/17/querying-bitwise-flags-in-attributes/</guid>
      <description><![CDATA[As you know several attributes in the Active Directory are composed of BITWISE flags. This means...]]></description>
      <content:encoded><![CDATA[<p>As you know several attributes in the Active Directory are composed of BITWISE flags. This means that the attribute consists of several flags which may be (or may be not) set on the attribute, and querying these attributes may sometimes be a real pain… </p>  <p><strong>The main purpose of this post is to present the LDAP_MATCHING_RULE_BIT_AND control, and how to use it when querying those bitwise flags in attributes.</strong></p>  <p>&#160;</p>  <p>Let look at the UserAccountControl attribute for example, this attribute controls the behavior of the user account.</p>  <p>In the msdn page describing the attribute you can find a full list of all possible flags for the attribute (<a title="https://msdn.microsoft.com/en-us/library/ms680832(VS.85).aspx" href="https://msdn.microsoft.com/en-us/library/ms680832(VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms680832(VS.85).aspx</a>).</p>  <p>Let’s look at some of the flags:</p>  <p>0x00000200 <a href="https://msdn.microsoft.com/en-us/library/aa772300(v=VS.85).aspx"><strong>ADS_UF_NORMAL_ACCOUNT</strong></a> This is a default account type that represents a typical user.</p>  <p>0x00010000 <a href="https://msdn.microsoft.com/en-us/library/aa772300(v=VS.85).aspx"><strong>ADS_UF_DONT_EXPIRE_PASSWD</strong></a> The password for this account will never expire.</p>  <p>0x00000002 <a href="https://msdn.microsoft.com/en-us/library/aa772300(v=VS.85).aspx"><strong>ADS_UF_ACCOUNTDISABLE</strong></a> The user account is disabled.</p>  <p>&#160;</p>  <p>Now let’s say we have a <strong>normal user account (userAccountControl flag set to 0x200 which is 512 decimal)</strong> which looks like this:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/3240.image_3A62B1D8.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/3240.image_5F00_3A62B1D8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" 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/85/03/metablogapi/1602.image_thumb_1535419F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/1602.image_5F00_thumb_5F00_1535419F.png" width="242" height="324" /></a> </p>  <p>&#160;</p>  <p>And then we set the <strong>password never expires flag (which is 0x10000)</strong>, so together we’ll get 0x10200 (which is 66048 decimal). This would look something like the following:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/7065.image_18F2E66F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/7065.image_5F00_18F2E66F.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" 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/85/03/metablogapi/8551.image_thumb_3AAE9933.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/8551.image_5F00_thumb_5F00_3AAE9933.png" width="243" height="324" /></a> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/5415.image_1731F4CE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/5415.image_5F00_1731F4CE.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" 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/85/03/metablogapi/8055.image_thumb_271113C5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/8055.image_5F00_thumb_5F00_271113C5.png" width="243" height="324" /></a> </p>  <p></p>  <p></p>  <p></p>  <p>So now the interesting part starts – <strong>if we also disable the account we will get the value of 0x10000 + 0x200 + 0x2= 0x10202 (66050 decimal).</strong></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/85/03/metablogapi/8154.image_63E59597.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/8154.image_5F00_63E59597.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" 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/85/03/metablogapi/3660.image_thumb_3F245853.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-03-metablogapi/3660.image_5F00_thumb_5F00_3F245853.png" width="243" height="324" /></a> </p>  <p>Right, so far so good… now i want to <strong>query all user accounts in the domain set with password never expires flag (regardless if they are enabled or disabled)</strong>…. </p>  <p>Huh??? query what??? why??? no… sorry… well…. hmmmm…. (sounds like a proper response to such a request, wouldn’t it? :) ). </p>  <p>While making all this sounds and vowels the thoughts going inside the head are: “Querying for userAccountControl=66048 wouldn’t get the disabled accounts, while querying for 66050 wouldn’t get the enabled accounts.”</p>  <p>So what’s the solution to the problem?? </p>  <p><strong>Query the specific BIT you want!</strong></p>  <p>Active Directory provides a control in order to query specific bits of a flag - 1.2.840.113556.1.4.803 (LDAP_MATCHING_RULE_BIT_AND).</p>  <p>Constructing the query is easy, you just have to <strong>query the attribute (userAccountControl) with the flag you need (ADF_UF_DONT_EXPIRE_PASSWD – 0x10000 in decimal – 65536)</strong>.</p>  <p>So using the provided example I will be able to query for all accounts with password never expires flag set by the following LDAP query - <strong>(&amp;(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))</strong></p>  <p>How do you do that using a script?</p>  <p><strong>Here’s a sample powershell script:</strong></p>  <pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$strFilter = &quot;<span style="color: #8b0000">(&amp;(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))</span>&quot;
</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$objDomain = New-Object System.DirectoryServices.DirectoryEntry
</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$objSearcher.SearchRoot = $objDomain
</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$objSearcher.Filter = $strFilter
</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$objSearcher.SearchScope = &quot;<span style="color: #8b0000">Subtree</span>&quot;
</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">$colResults = $objSearcher.FindAll()
</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"><span style="color: #0000ff">foreach</span> ($objResult <span style="color: #0000ff">in</span> $colResults)
</pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">    {$objResult.path}
</pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"></pre></pre>

<p>&#160;</p>

<p>Hope this helps in querying the BITWISE attributes</p>]]></content:encoded>
    </item>
    <item>
      <title>My Tech-ed Session References (DTC300 – Turbo Charge your Active Directory)</title>
      <link>https://docs.microsoft.com/archive/blogs/isrpfeplat/my-tech-ed-session-references-dtc300-turbo-charge-your-active-directory</link>
      <pubDate>Sat, 27 Nov 2010 11:19:00 GMT</pubDate>
      <dc:creator><![CDATA[michdu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/isrpfeplat/2010/11/27/my-tech-ed-session-references-dtc300-turbo-charge-your-active-directory/</guid>
      <description><![CDATA[Hi,
&nbsp;
Thank you all for attending my Session.. hope you had fun :-)
&nbsp;
Here&rsquo;s a...]]></description>
      <content:encoded><![CDATA[<p>Hi,</p>
<p>&nbsp;</p>
<p>Thank you all for attending my Session.. hope you had fun :-)</p>
<p>&nbsp;</p>
<p>Here&rsquo;s a list of all references on the topics i&rsquo;ve been discussing:</p>
<p><strong>1. New AD Features:</strong></p>
<blockquote>
<p>a. Recycle Bin - <a href="https://technet.microsoft.com/en-us/library/dd392261(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/dd392261(WS.10).aspx">https://technet.microsoft.com/en-us/library/dd392261(WS.10).aspx</a></p>
<p>b. Recycle Bin - <a href="https://blogs.technet.com/b/qzaidi/archive/2010/10/23/quickly-explained-active-directory-recycle-bin.aspx" title="https://blogs.technet.com/b/qzaidi/archive/2010/10/23/quickly-explained-active-directory-recycle-bin.aspx">https://blogs.technet.com/b/qzaidi/archive/2010/10/23/quickly-explained-active-directory-recycle-bin.aspx</a></p>
<p>c. AD Module for Powershell - <a href="https://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx">https://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx</a></p>
<p>d. AD Web Services - <a href="https://blogs.msdn.com/b/adpowershell/archive/2009/04/06/active-directory-web-services-overview.aspx" title="https://blogs.msdn.com/b/adpowershell/archive/2009/04/06/active-directory-web-services-overview.aspx">https://blogs.msdn.com/b/adpowershell/archive/2009/04/06/active-directory-web-services-overview.aspx</a></p>
<p>e. Managed Service Accounts - <a href="https://blogs.technet.com/b/askds/archive/2009/09/10/managed-service-accounts-understanding-implementing-best-practices-and-troubleshooting.aspx" title="https://blogs.technet.com/b/askds/archive/2009/09/10/managed-service-accounts-understanding-implementing-best-practices-and-troubleshooting.aspx">https://blogs.technet.com/b/askds/archive/2009/09/10/managed-service-accounts-understanding-implementing-best-practices-and-troubleshooting.aspx</a></p>
<p>f. Fine Grained Password Policies - <a href="https://technet.microsoft.com/en-us/library/cc770842(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc770842(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc770842(WS.10).aspx</a></p>
</blockquote>
<p><strong>2. AD Replication</strong></p>
<blockquote>
<p>a. How AD Replication works - <a href="https://technet.microsoft.com/en-us/library/cc772726(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc772726(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc772726(WS.10).aspx</a></p>
<p>b. How DC are located in Windows - <a href="https://support.microsoft.com/kb/247811" title="https://support.microsoft.com/kb/247811">https://support.microsoft.com/kb/247811</a></p>
<p>c. Finding DCs in closest site - <a href="https://technet.microsoft.com/en-us/library/cc978016.aspx" title="https://technet.microsoft.com/en-us/library/cc978016.aspx">https://technet.microsoft.com/en-us/library/cc978016.aspx</a></p>
<p>d. Subnet to Site mapping - <a href="https://support.microsoft.com/kb/889031" title="https://support.microsoft.com/kb/889031">https://support.microsoft.com/kb/889031</a></p>
<p>e. Enabling Inter-Site change notifications - <a href="https://blogs.technet.com/b/qzaidi/archive/2010/09/23/enable-change-notifications-between-sites-how-and-why.aspx" title="https://blogs.technet.com/b/qzaidi/archive/2010/09/23/enable-change-notifications-between-sites-how-and-why.aspx">https://blogs.technet.com/b/qzaidi/archive/2010/09/23/enable-change-notifications-between-sites-how-and-why.aspx</a></p>
</blockquote>
<blockquote>
<p>f. Tombstone Lifetime events - <a href="https://technet.microsoft.com/en-us/library/cc757610(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc757610(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc757610(WS.10).aspx</a></p>
<p>g. Information about lingering objects - <a href="https://support.microsoft.com/kb/910205" title="https://support.microsoft.com/kb/910205">https://support.microsoft.com/kb/910205</a></p>
<p>h. Fixing Lingering objects problems - <a href="https://technet.microsoft.com/en-us/library/cc738018(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc738018(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc738018(WS.10).aspx</a></p>
</blockquote>
<p><strong>3. DC Virtualization</strong></p>
<blockquote>
<p>a. How to Virtualize DCs &ndash; Part 1 - <a href="https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-1.aspx" title="https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-2.aspx">https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-1.aspx</a></p>
<p>b. How to Virtualize DCs &ndash; Part 2 - <a href="https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-2.aspx" title="https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-2.aspx">https://blogs.technet.com/b/askds/archive/2010/06/15/how-to-virtualize-active-directory-domain-controllers-part-2.aspx</a></p>
<p>c. Planning considerations for Virtualized DCs - <a href="https://technet.microsoft.com/en-us/library/dd348476(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/dd348476(WS.10).aspx">https://technet.microsoft.com/en-us/library/dd348476(WS.10).aspx</a></p>
<p>d. Things to consider when hosting virtual DCs - <a href="https://support.microsoft.com/kb/888794" title="https://support.microsoft.com/kb/888794">https://support.microsoft.com/kb/888794</a></p>
</blockquote>
<p><strong>4. Group Policy features</strong></p>
<blockquote>
<p>a. Managing ADMX files - <a href="https://technet.microsoft.com/en-us/library/cc709647(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc709647(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc709647(WS.10).aspx</a></p>
<p>b. How to create a Central Policy store - <a href="https://support.microsoft.com/kb/929841" title="https://support.microsoft.com/kb/929841">https://support.microsoft.com/kb/929841</a></p>
</blockquote>
<blockquote>
<p>c. Group Policy Preferences - <a href="https://technet.microsoft.com/en-us/library/dd367850(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/dd367850(WS.10).aspx">https://technet.microsoft.com/en-us/library/dd367850(WS.10).aspx</a></p>
<p>d. Group Policy Preferences &ndash; Getting Started - <a href="https://technet.microsoft.com/en-us/library/cc731892(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc731892(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc731892(WS.10).aspx</a></p>
<p>e. Policy vs. Preferences vs. GP Preferences - <a href="https://blogs.technet.com/b/grouppolicy/archive/2008/03/04/gp-policy-vs-preference-vs-gp-preferences.aspx" title="https://blogs.technet.com/b/grouppolicy/archive/2008/03/04/gp-policy-vs-preference-vs-gp-preferences.aspx">https://blogs.technet.com/b/grouppolicy/archive/2008/03/04/gp-policy-vs-preference-vs-gp-preferences.aspx</a></p>
<p>d. 2003/XP/Vista Preferences Client Side Extension download - <a href="https://support.microsoft.com/?id=943729" title="https://support.microsoft.com/?id=943729">https://support.microsoft.com/?id=943729</a></p>
</blockquote>
<p><strong>5. Advanced Group Policy Management Console (AGPM)</strong></p>
<blockquote>
<p>a. AGPM Overview - <a href="https://technet.microsoft.com/en-us/library/cc749396(WS.10).aspx" title="https://technet.microsoft.com/en-us/library/cc749396(WS.10).aspx">https://technet.microsoft.com/en-us/library/cc749396(WS.10).aspx</a></p>
<p>b. AGPM 4.0 Home - <a href="https://technet.microsoft.com/en-us/library/ee382452.aspx" title="https://technet.microsoft.com/en-us/library/ee382452.aspx">https://technet.microsoft.com/en-us/library/ee382452.aspx</a></p>
</blockquote>
<p><strong>6. Monitoring</strong></p>
<blockquote>
<p>a. AD Management Pack download (includes documentation) - <a href="https://www.microsoft.com/downloads/details.aspx?FamilyID=008F58A6-DC67-4E59-95C6-D7C7C34A1447&amp;amp;displaylang=fr&amp;displaylang=en" title="https://www.microsoft.com/downloads/details.aspx?FamilyID=008F58A6-DC67-4E59-95C6-D7C7C34A1447&amp;amp;displaylang=fr&amp;displaylang=en">https://www.microsoft.com/downloads/details.aspx?FamilyID=008F58A6-DC67-4E59-95C6-D7C7C34A1447&amp;amp;displaylang=fr&amp;displaylang=en</a></p>
<p>b. Monitoring AD detailed explanation (older version) - <a href="https://technet.microsoft.com/en-us/library/bb727046.aspx" title="https://technet.microsoft.com/en-us/library/bb727046.aspx">https://technet.microsoft.com/en-us/library/bb727046.aspx</a></p>
<p>c. SCOM Home - <a href="https://www.microsoft.com/systemcenter/en/us/operations-manager.aspx" title="https://www.microsoft.com/systemcenter/en/us/operations-manager.aspx">https://www.microsoft.com/systemcenter/en/us/operations-manager.aspx</a></p>
</blockquote>
<p>&nbsp;</p>
<p>That oughta keep you guys busy reading for a while&hellip; feel to come back for more :-)</p>
<p>&nbsp;</p>
<p>-Michael.</p>]]></content:encoded>
    </item>
  </channel>
</rss>