<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ldap389</title>
	
	<link>http://www.ldap389.info/en/</link>
	<description>Active Directory Blog</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:29:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Ldap389" /><feedburner:info uri="ldap389" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>GPO WMI filtering: KB2286198 workaround</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/YwHIOTIfenk/</link>
		<comments>http://www.ldap389.info/en/2010/08/07/gpo-wmi-filtering-false-is-not-kb2286198/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 17:50:41 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[adm @en]]></category>
		<category><![CDATA[gpmc @en]]></category>
		<category><![CDATA[PowerShell @en]]></category>
		<category><![CDATA[rsop @en]]></category>
		<category><![CDATA[wmi @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=681</guid>
		<description><![CDATA[You might already know that Windows 2000 and XP SP2 are not supported by MS since the 13th of july 2010. As a consequence you cannot install new security patches released by MS on these platforms. A critical security vulnerability MS10-46 is corrected by the KB2286198 patch which was released the 3rd of august. This [...]]]></description>
			<content:encoded><![CDATA[<p>You might already know that Windows 2000 and XP SP2 are <a href="http://blogs.technet.com/b/askperf/archive/2010/07/13/support-changes-for-windows-2000-windows-xp-sp2-and-windows-vista.aspx">not supported by MS</a> since the 13th of july 2010. As a consequence you cannot install new security patches released by MS on these platforms. A critical security vulnerability <a href="http://www.microsoft.com/france/technet/security/Bulletin/MS10-046.mspx">MS10-46</a> is corrected by the <a href="http://support.microsoft.com/kb/2286198">KB2286198</a> patch which was released the 3rd of august. This patch applies at least to Windows XP SP3 (for workstation versions) and Windows 2003 SP2 (for server versions). The KB article explains a workaround for the security patch, you need to edit two registry keys and disable a service.</p>
<p>You can apply this workaround on earlier version of Windows, if all your computers are not up to date. The disavdantage of this method is that icon images will disappear on some of your <em>*.lnk</em> files. So my advice is to upgrade as soon as possible your computers to a version which is supported by MS and apply the official security patch. Use the workaround only as last resort, the purpose of this post is to show you how to deploy this workaround with a GPO and play with WMI filtering. The Group Policy Center already wrote <a href="http://www.grouppolicy.biz/2010/08/how-to-workaround-kb2286198-shortcut-icon-security-issues-with-group-policy/">an article</a> on how to deploy this workaround with GPO. We will just show you in this post how to target more precisely your computers which need the workaround by using WMI filers. We will achieve this under Windows 2008 by using <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=42e30e3f-6f01-4610-9d6e-f6e0fb7a0790&amp;DisplayLang=en">Group Policy Preferences</a> and activate the GPO workaround on the computers which have not the KB2286198 security patch installed. And we will show you how to achieve the same thing under AD 2003, without using Group Policy Preferences.<br />
<span id="more-681"></span></p>
<p>First, we will show you how to apply the <a href="http://www.grouppolicy.biz/2010/08/how-to-workaround-kb2286198-shortcut-icon-security-issues-with-group-policy/"> Group Policy Center </a>workaround by targeting only computers which have not the security patch installed. For this we will use <em><a href="http://technet.microsoft.com/en-us/library/cc733022.aspx">Item-Level targeting</a></em>. If you want to use Group Policy Preferences you need at least a DC running Windows 2008 in your domain and apply <a href="http://support.microsoft.com/kb/943729">this KB</a> on all your client computers, do not forget to install XMLLite on computers running Windows 2003 and Windows XP. One of the cool features about <em>Item-Level targeting</em> is <a href="http://technet.microsoft.com/en-us/library/cc753660.aspx"><em>Targeting Collection</em></a>: You can add a &#8220;IS NOT&#8221; statement in your filter (i.e. request result is FALSE). With standard WMI filtering (i.e. not using Group policy Preference) you just can filter if the request returns TRUE, so you cannot filter if a KB is not installed, just if a KB is installed. In order to deploy the workaround on computers which have not KB2286198 installed just add <em>Item-Level targeting</em> on the registry key update and service deactivation:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/wmiquery2008-1.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-662" title="wmiquery2008-1" src="http://www.ldap389.info/wp-content/uploads/2010/08/wmiquery2008-1-300x223.jpg" alt="" width="300" height="223" /></a></p>
<p>The WMI request to retrieve if KB patch is installed browses the <em>Win32_QuickFixEngineering</em> class by filtering on HotFixID = &#8216;KB2286198&#8242;.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/wmiquery2008-2.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-663" title="wmiquery2008-2" src="http://www.ldap389.info/wp-content/uploads/2010/08/wmiquery2008-2-300x180.jpg" alt="" width="300" height="180" /></a></p>
<p>In order to disable the workaround just use the same WMI request and use default <em>Targeting Collection</em>, which applies if WMI filter returns TRUE. See part &#8220;disable workaround&#8221; in the <a href="http://www.grouppolicy.biz/2010/08/how-to-workaround-kb2286198-shortcut-icon-security-issues-with-group-policy/">Group Policy Center</a> post, to know which registry key and WebClient settings to edit.</p>
<p>If your AD is still running with just Windows 2003 DCs, you cannot use Group Policy Preferences and a WMI filter only applies if the request returns TRUE, which is the standard behaviour. In order to bypass this limitation it is a bit tricky: We will create two GPOs and we will apply them in a particular order (priority):</p>
<ul>
<li>First GPO (<em>KB2286198-WOKAROUND-AD2003-Enable</em>) which will enable the workaround on all your workstations (no filtering): It will disable the WebClient Service and edit registry keys <em>HKCR\lnkfile\shellex\IconHandler</em> et <em>HKCR\piffile\shellex\IconHandler</em> and <em>HKCR\lnkfile\shellex\IconHandler</em> with a void <em>default</em> value. When the computer processes Group Policy, <em>KB2286198-WOKAROUND-AD2003-Enable</em> will be applied before the second GPO, so it&#8217;s priority will be lower.</li>
<li>Second GPO (<em>KB2286198-WOKAROUND-AD2003-Disable</em>) which will disable the workaround on workstations with KB2286198 installed, by using a standard WMI filter. This GPO enables WebClient service at startup and edit the registry <em>default</em> value to its original setting ({00021401-0000-0000-C000-000000000046}). This GPO will have a higher priority than the first one, it will be applied after <em>KB2286198-WOKAROUND-AD2003-Enable</em> during the computer&#8217;s group policy processing.</li>
</ul>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/ordreGPO2003.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-665" title="ordreGPO2003" src="http://www.ldap389.info/wp-content/uploads/2010/08/ordreGPO2003-300x40.jpg" alt="" width="300" height="40" /></a></p>
<p>In order to push the registry values mentioned earlier, without Group Policy preference, you will need to generate a <a href="http://support.microsoft.com/kb/323639">custom administrative template</a> with <a href="http://yizhar.mvps.org/">Yizhar Hurwitz&#8217;s</a> tool: Reg2adm.If you need a tutorial on how to use it you can read this <a href="http://www.virtualizationadmin.com/articles-tutorials/terminal-services/general/group-policy-support-custom-applications-environment.html">post</a>. Otherwise if you just want to download both .ADM files just click on the image below:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/ADM-KB2286198.zip"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>The WMI filter you need to apply on the second GPO <em>KB2286198-WOKAROUND-AD2003-Disable</em> is still the same as under Windows 2008:</p>
<blockquote><p>SELECT * FROM Win32_QuickFixEngineering WHERE HOTFixID = &#8216;KB2286198&#8242;</p></blockquote>
<p>If you still (!) have Windows 2000 workstations and servers in you domain they will <a href="http://technet.microsoft.com/en-us/library/cc758471%28WS.10%29.aspx">ignore the WMI filter.</a> The GPO <em>KB2286198-WOKAROUND-AD2003-Disable </em>will always be applied to those computers, but you need to apply the workaround to them because the security patch cannot be installed on a W2K OS.</p>
<p>We will create a security group called <em>W2K-WORKSTATIONS</em> whose members are all our Windows 2000 computers. For that we will use <a href="http://www.quest.com/powershell/activeroles-server.aspx">Quest AD CMDlets</a> and launch the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">get<span style="color: pink;">-</span>QADComputer <span style="color: pink;">-</span>OSName <span style="color: #800000;">'Windows 2000*'</span> <span style="color: pink;">-</span>ldapFilter <span style="color: #800000;">'(!(userAccountControl:1.2.840.113556.1.4.803:=2))'</span> <span style="color: pink;">-</span>Sizelimit <span style="color: #000000;">10000</span> <span style="color: pink;">|</span> Add<span style="color: pink;">-</span>QADMemberof <span style="color: pink;">-</span><span style="color: #008080; font-weight: bold;">Group</span> <span style="color: #800000;">'ldap389\W2K-WORKSTATIONS'</span></pre></div></div>

<p>Then we will set up a group security filtering on the GPO<em>KB2286198-WOKAROUND-AD2003-Disable </em>in order to deny its application for the <em>W2K-WORKSTATIONS</em> group.</p>
<p>The GPO <em>KB2286198-WOKAROUND-AD2003-Enable </em>looks like this:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/wmi-GPO2-2003.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-666" title="wmi-GPO2-2003" src="http://www.ldap389.info/wp-content/uploads/2010/08/wmi-GPO2-2003-300x282.jpg" alt="" width="300" height="282" /></a></p>
<p>And GPO <em>KB2286198-WOKAROUND-AD2003-Disable </em>with an higher priority than <em>KB2286198-WOKAROUND-AD2003-Enable </em> looks like this (WMI + security filtering):</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/wmi-GPO1-2003.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-667" title="wmi-GPO1-2003" src="http://www.ldap389.info/wp-content/uploads/2010/08/wmi-GPO1-2003-300x162.jpg" alt="" width="300" height="162" /></a></p>
<p>On the image bellow is the startup menu and the <a href="http://support.microsoft.com/kb/323276">resultant set of policy</a> on a computer with KB2286198 installed and on a computer with workaround applied:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/08/rsop2003.jpg" rel="lightbox[681]"><img class="aligncenter size-medium wp-image-669" title="rsop2003" src="http://www.ldap389.info/wp-content/uploads/2010/08/rsop2003-300x256.jpg" alt="" width="300" height="256" /></a></p>
<p>By using GPO processing order we can achieve what we want but it is a bit makeshift&#8230; As a conclusion keep your OS updated, in the future there might be no simple workarounds to halt a critical security breach</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/YwHIOTIfenk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/08/07/gpo-wmi-filtering-false-is-not-kb2286198/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/08/07/gpo-wmi-filtering-false-is-not-kb2286198/</feedburner:origLink></item>
		<item>
		<title>Powershell: restore AD object with group membership</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/7T7M-mrzlgU/</link>
		<comments>http://www.ldap389.info/en/2010/08/05/powershell-restore-ad-object-with-group-membership/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 18:03:18 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[Disaster recovery @en]]></category>
		<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[PowerShell @en]]></category>
		<category><![CDATA[tombstone @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=623</guid>
		<description><![CDATA[The purpose of this article is to show how to restore deleted objects with their group membership using Powershell. In order to achieve this you will need to set up a lag site in your domain. If your domain functional level is Windows 2008R2 and you have turned on the recycle bin, you can simply [...]]]></description>
			<content:encoded><![CDATA[<p>The purpose of this article is to show how to restore deleted objects with their group membership using Powershell. In order to achieve this you will need to set up <a href="http://blogs.technet.com/b/askds/archive/2008/10/20/lag-site-or-hot-site-aka-delayed-replication-for-active-directory-disaster-recovery-support.aspx">a lag site</a> in your domain. If your domain functional level is Windows 2008R2 and you have turned on the <a href="http://technet.microsoft.com/en-us/library/dd392261(WS.10).aspx">recycle bin</a>, you can simply restore an object with its group membership using <a href="http://blogs.msdn.com/b/dsadsi/archive/2009/08/26/restoring-object-from-the-active-directory-recycle-bin-using-ad-powershell.aspx"> Microsoft Powershell 2.0 Cmdlets</a> without any lag site.</p>
<p>The method we will describe to achieve practically the same result works starting Windows 2003 server and later versions. We will restore objects from the <a href="http://technet.microsoft.com/en-us/magazine/2007.09.tombstones.aspx">Tombstone</a> using <a href="http://www.quest.com/powershell/activeroles-server.aspx">Quest AD Cmdlets</a>, your administration console should be at least running Windows XP, you do not need to install the <a href="http://blogs.msdn.com/b/adpowershell/archive/2009/03/24/active-directory-powershell-installation-using-rsat-on-windows-7.aspx">RSAT</a> (running on Windows 7 and 2008 server). You might have noticed on the <em>&#8220;<a href="http://www.ldap389.info/2010/07/05/sidebar-du-blog-latest-ad-news/">latest AD news sidebar</a>&#8220;</em> that QAD Cmdlets <a href="http://dmitrysotnikov.wordpress.com/2010/07/16/whats-new-in-ad-cmdlets-1-4/">version 1.4</a> was released a few days ago. The disadvantage of the method described is that it might be not supported by MS, for best practices regarding deleted objects restore you can read this <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;840001">KB article</a>, you will also need to modify your Active Directory schema. Use this method if a few accounts are deleted, if have you deleted an entire OU use a proper authoritative restore. The advantage of using the powershell script is that the restore process is really quick.</p>
<p><span id="more-623"></span><br />
Once an object is deleted, it is moved in to the Tombstone, some of the object&#8217;s attributes are erased for good. One of those attributes is the account password, when you restore a user or computer using the tombstone reanimation you cannot by default restore its password, which can be really annoying. In order to avoid this deletion you will need to modify your schema and update the <em>SearchFlags</em> attribute on this object: <em>CN=Unicode-Pwd,CN=Schema,CN=Configuration,DC=domain</em>. You can read <a href="http://4sysops.com/archives/how-to-save-additional-active-directory-attributes-and-the-password-in-tombstone-objects/">Michael Pietroforte&#8217;s post</a> to have more details and to know how to set up the attributes you do not want to be erased for good when an object is moved to the tombstone.</p>
<p>Unfortunately you cannot modify the Active Directory schema in order to store the group membership of a tombstone object, that is why you need a <a href="http://blogs.technet.com/b/askds/archive/2008/10/20/lag-site-or-hot-site-aka-delayed-replication-for-active-directory-disaster-recovery-support.aspx">lag site</a> to retrieve groups membership of an object. On this site the <a href="http://technet.microsoft.com/en-us/library/cc779337(WS.10).aspx">replication schedule </a>is different: For example replication is only allowed once a day between 0h and 0h30, as a consequence an object deletion is not replicated immediately to the DC in this site. If the deletion occurred during the day you will be able to read the object group membership till midnight, then you can import the groups membership you just retrieved on the lag site into the reanimated object.</p>
<p>The Quest AD command to <a href="http://wiki.powergui.org/index.php/Restore-QADDeletedObject">restore a deleted user object</a> and then activate the user account is:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>QADUser <span style="color: pink;">-</span>SamAccountName <span style="color: #800080;">$AccountRestore</span> <span style="color: pink;">|</span> Restore<span style="color: pink;">-</span>QADDeletedObject <span style="color: pink;">|</span> Enable<span style="color: pink;">-</span>QADUser   .......</pre></div></div>

<p><strong>$AccountRestore</strong> is the user account <em>SamAccountName</em> you need to restore from the tombstone. In order to restore a computer account just use  <strong>Get-QADComputer</strong> instead. For a group you do not need to activate it&#8230; just use the <strong>Get-QADGroup</strong> Cmdlet.</p>
<p>Once user the account is restored we need to read its groups membership on the lag site and import this information into the freshly restored account:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">.... <span style="color: pink;">|</span> Get<span style="color: pink;">-</span>QADMemberof <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_LAG_FQDN</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#123;</span> <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.name <span style="color: #FF0000;">-ne</span> <span style="color: #800000;">&quot;Domain Users&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>Add<span style="color: pink;">-</span>QADGroupMember <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_FQDN</span> <span style="color: #000080;">$_</span> <span style="color: pink;">-</span>Member <span style="color: #800080;">$AccountRestore</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p><strong>$DC_LAG_FQDN </strong>is the Domain Controller name located in the lag site, then you connect back to <strong>$DC_FQDN</strong> (DC were object was restored) and add group membership you just read. You import all groups except <em>&#8220;Domain users&#8221;</em> because the restored account is already member of this group. Use the same method for a computer object but this time just exclude <em>&#8220;Domain computers&#8221;.</em></p>
<p>Restoring group objects is a bit more tricky: Because a group has members and can also be member of other groups. So you need to process first the <em>members</em> part and then the <em>member of</em> part, to achieve this use the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">.... <span style="color: pink;">|</span> <span style="color: pink;">%</span><span style="color: #000000;">&#123;</span>Get<span style="color: pink;">-</span>QADMemberof <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_LAG_FQDN</span> <span style="color: #000080;">$_</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#123;</span> Add<span style="color: pink;">-</span>QADGroupMember <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_FQDN</span> <span style="color: pink;">-</span>Member <span style="color: #800080;">$AccountRestore</span><span style="color: #000000;">&#125;</span> ; <span style="color: #000000;">&#123;</span>Get<span style="color: pink;">-</span>QADGroupMember <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_LAG_FQDN</span> <span style="color: #000080;">$_</span> <span style="color: pink;">|</span> Add<span style="color: pink;">-</span>QADMemberOf <span style="color: pink;">-</span>service <span style="color: #800080;">$DC_FQDN</span> <span style="color: pink;">-</span><span style="color: #008080; font-weight: bold;">Group</span> <span style="color: #800080;">$AccountRestore</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p>As you can see, restoring an object with group membership can be done in Powershell with a <a href="http://www.energizedtech.com/2010/03/powershell-the-power-of-the-on.html">one liner</a>. You can download the <strong>.ps1</strong> script bellow, which performs the restore of the three kind of objects: users, computers and groups.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/reanimator.ps1"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>You just need to edit the following variables:</p>
<ul>
<li><strong>$Domain</strong>: Your domain NetBios name.</li>
<li><strong>$DC_FQDN</strong>: Domain Controller FQDN where the object is deleted.</li>
<li><strong>$DC_LAG_FQDN</strong>: Domain Controller FQDN located in your lag site.</li>
<li><strong>$AdminAD</strong>: Your admin account.</li>
</ul>
<p>Once you launched the script just input the kind of object you need to restore: 1 for user, 2 for computer and 3 for group. Then enter your admin account password, and finally the account name you want to restore.</p>
<p>This script can be improved by adding new features: For example if you have no lag site, you could query all the DCs in your domain in order to get one DC where the deletion was not replicated yet, <a href="http://technet.microsoft.com/en-us/library/cc787395(WS.10).aspx"> suspend inbound replication</a> on this DC by using repadmin.exe, read group membership of the account which was deleted on other DCs, restore the object with group membership and <a href="http://technet.microsoft.com/en-us/library/cc783692(WS.10).aspx">turn back on inbound replication</a> once restoration is completed.  </p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/7T7M-mrzlgU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/08/05/powershell-restore-ad-object-with-group-membership/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/08/05/powershell-restore-ad-object-with-group-membership/</feedburner:origLink></item>
		<item>
		<title>GPMC hangs connected to one domain controller</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/FGtiye5AMQo/</link>
		<comments>http://www.ldap389.info/en/2010/07/26/gpmc-freezes-hangs-connected-domain-controller/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 11:20:41 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[AD Database]]></category>
		<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[troubleshooting @en]]></category>
		<category><![CDATA[cpu @en]]></category>
		<category><![CDATA[gplink @en]]></category>
		<category><![CDATA[gpmc @en]]></category>
		<category><![CDATA[ntds.dit @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=593</guid>
		<description><![CDATA[I will describe in this post an incident we had in our production environment and the different troubleshooting steps to resolve this issue. When we launched a GPMC, the console froze when we clicked on an OU in order to display the Policy Objects linked to it. The problem occurred only when the GPMC was [...]]]></description>
			<content:encoded><![CDATA[<p>I will describe in this post an incident we had in our production environment and the different troubleshooting steps to resolve this issue. When we launched a GPMC, the console froze when we clicked on an OU in order to display the Policy Objects linked to it. The problem occurred only when the GPMC was connected to a particular Domain Controller (PDC emulator in our case), if we <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;214676&#038;Product=win20">switched to another DC</a> the GPMC was OK.</p>
<p>There was no problem with GPOs in our domain: Replication was ok and GPOs were applied correctly on our computers/users objects. But we could not edit anymore GPOs connected to this DC. While the GPMC was hanging there was a lsass.exe CPU overload on the DC until the console was killed. Therefore we had to edit GPOs connected to any other DC, so the production environment was working near normal during the resolution of the incident.</p>
<p><span id="more-593"></span><br />
The first thing we did was to launch an analysis with <a href="http://www.microsoft.com/downloads/details.aspx?familyid=61a41d78-e4aa-47b9-901b-cf85da075a73&#038;displaylang=en">Server Performance Advisor</a> on the DC while the GPMC was hanging, here is the result:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/spa.jpg" rel="lightbox[593]"><img class="aligncenter size-medium wp-image-575" title="server performance advisor lsass" src="http://www.ldap389.info/wp-content/uploads/2010/05/spa-300x125.jpg" alt="" width="300" height="125" /></a></p>
<p>Apparently the DC has a problem performing an LDAP request initiated by the GPMC, and that is why the lsass.exe process on the DC consumes so much CPU time. In order to confirm this we will do two network packets captures with <a href="http://www.wireshark.org/">WireShark</a> on our admin workstation, we will perform the same manipulations under GPMC, clicking on an OU to display GPOs linked to it: First with the GPMC connected to the problematic DC, console frozen after clicking on the OU. Second with the GPMC connected to another DC, where GPOs display and edition works fine:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/wireshark-ldap.jpg" rel="lightbox[593]"><img class="aligncenter size-medium wp-image-577" title="wireshark-ldap" src="http://www.ldap389.info/wp-content/uploads/2010/05/wireshark-ldap-217x300.jpg" alt="" width="217" height="300" /></a></p>
<p>On the first capture you can see that the LDAP request returns no result after two minutes, then we decided to kill the console. On the second one the LDAP request returns a result (a GPO <em>DistinguishedName</em>) after a few seconds.</p>
<p>We need now to identify what kind of LDAP request the DC could  not perform, because all other LDAP requests were performed by the DC, for example searching for computers under the DSA console connected to this DC worked fine. For that we need to turn  on Active Directory diagnostic event logging, especially <a href="http://support.microsoft.com/kb/314980/en-us"><em>Field Engineering</em></a> , Event ID <a href="http://support.microsoft.com/kb/951581/en-us">1644 </a> will be written in the event log when the LDAP request initiated by the GPMC will be performed, this event ID tells us that an inefficient LDAP query was performed and gives us the following information:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/EventField.jpg" rel="lightbox[593]"><img class="aligncenter size-medium wp-image-578" title="Event 1644" src="http://www.ldap389.info/wp-content/uploads/2010/05/EventField-269x300.jpg" alt="" width="269" height="300" /></a></p>
<p>Results returned by the query should be the attributes <a href="http://msdn.microsoft.com/en-us/library/cc232505%28PROT.13%29.aspx"><em>GPLink and GPOptions</em></a>, exactly what we expect, because by clicking on an OU under GPMC you want to display the GPOs linked to it (by the way that&#8217;s the result returned by the second network capture).<br />
The attribute used as a filter for the LDAP query is <a href="http://msdn.microsoft.com/en-us/library/ms677612%28VS.85%29.aspx"><em>ObjectCategory</em></a> which is an <a href="http://support.microsoft.com/kb/257218/en-us">indexed attribute</a> of the AD Database. As a consequence the LDAP request should be performed quickly, which is not our case at all.  We tried to launch the same request with <a href="http://support.microsoft.com/kb/224543/en-us">ldp.exe tool</a>, here the result:</p>
<blockquote><p>&#8212;&#8212;&#8212;&#8211;<br />
***Searching…<br />
ldap_search_ext_s(ld, “DC=ldap389,DC=info”<br />
, 2, “( |  (objectCategory=CN=Domain-DNS,CN=Schema,CN=Configuration,DC=ldap389,DC=info)  (objectCategory=CN=Organizational-Unit,CN=Schema,CN=Configuration,DC=ldap389,DC=info) )”, attrList,  0, svrCtrls, ClntCtrls, 10, 0 ,&#038;msg)<br />
Error: Search: Timeout. <85><br />
Server error:<br />
Error<94>: ldap_parse_result failed: No result present in message<br />
Getting 0 entries:<br />
&#8212;&#8212;&#8212;&#8211;</p></blockquote>
<p>We have a TimeOut, we tried the same request on other DCs and got no TimeOut at all. As a first step we decided to increase the value of the parameter <em>MaxQueryDuration</em> of the <a href="http://support.microsoft.com/kb/315071/en-us">DC LDAP policy</a>, and also increase the TimeOut parameter of ldp.exe, but with no significant results.</p>
<p>After some research on the web I stumbled on this very interesting <a href="http://blogs.technet.com/ad/archive/2008/04/01/how-to-create-a-mosiac-of-user-thumbnails-in-aduc-dsa-msc.aspx">article</a> written by Tim Springston. It says that:</p>
<blockquote><p><em>&#8220;if the attribute(s) which are showing as taking an extended amount of time to search for are already indexed then the lack of an index is clearly not your problem.  Sometimes indices, perhaps through frequent changes or other reasons, need to be re-indexed to remove &#8220;whitespace&#8221; or other problems.  So checking the integrity of the database or doing an offline defrag may be the way to go.&#8221;</em></p></blockquote>
<p>So let&#8217;s do a <a href="http://support.microsoft.com/kb/315136/en-us">semantic analysis </a>of the DC&#8217;s ntds.dit file:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/semanalysis.jpg" rel="lightbox[593]"><img class="aligncenter size-medium wp-image-579" title="semantic-analysis-ad" src="http://www.ldap389.info/wp-content/uploads/2010/05/semanalysis-300x95.jpg" alt="" width="300" height="95" /></a></p>
<p>Inconsistent refcounts were detected: We launch this time the same analysis but in <em><a href="http://support.microsoft.com/kb/258062/en-us">&#8220;fix mode&#8221;</a></em> (KB&#8217;s step 11). Finally we proceed with an <a href="http://support.microsoft.com/kb/232122/en-us">offline defragmentation</a> of the database and exit DSRM mode.</p>
<p>Once the DC restarted we can use GPMC again connected to it: No more hanging when displaying GPOs and no more lsass.exe process CPU overconsumption.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/FGtiye5AMQo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/07/26/gpmc-freezes-hangs-connected-domain-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/07/26/gpmc-freezes-hangs-connected-domain-controller/</feedburner:origLink></item>
		<item>
		<title>Sidebar add-on: Latest AD news</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/XFbMf_Os_Pc/</link>
		<comments>http://www.ldap389.info/en/2010/07/05/sidebar-add-on-latest-ad-news/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 20:54:16 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[gpo]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=597</guid>
		<description><![CDATA[A new category has been added to the blog sidebar called “Latest AD news”. This add-on gives you access to all the latest posts I have found on the web that are relevant and related to Active Directory. You will notice the release of GPS a few days ago, this application is a search engine dedicated to GPOs. Input a keyword and it [...]]]></description>
			<content:encoded><![CDATA[<p>A new category has been added to the blog sidebar called <em>“Latest AD news”. T</em>his add-on gives you access to all the latest posts I have found on the web that are relevant and related to Active Directory. You will notice the release of <a href="http://gps.cloudapp.net/">GPS</a> a few days ago, this application is a search engine dedicated to GPOs. Input a keyword and it gives you the right parameters to edit under your GPMC. For more information about this tool, read this <a href="http://blogs.technet.com/b/askds/archive/2010/06/24/announcing-the-group-policy-search-service.aspx">AskDS</a> post.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/XFbMf_Os_Pc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/07/05/sidebar-add-on-latest-ad-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/07/05/sidebar-add-on-latest-ad-news/</feedburner:origLink></item>
		<item>
		<title>Restricted groups policy</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/-zU_0BbgfiY/</link>
		<comments>http://www.ldap389.info/en/2010/05/12/restricted-groups-policy/#comments</comments>
		<pubDate>Wed, 12 May 2010 10:09:50 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=508</guid>
		<description><![CDATA[With restricted group policies you can define the content of the local groups on your workstations and servers. Thanks to these GPOs you can set up which domain groups will be local administrators, power users, remote desktop users etc. on the PCs. If you want more details about restricted group policies and can understand French [...]]]></description>
			<content:encoded><![CDATA[<p>With restricted group policies you can define the content of the local groups on your workstations and servers. Thanks to these GPOs you can set up which domain groups will be local administrators, power users, remote desktop users etc. on the PCs.</p>
<p>If you want more details about restricted group policies and can understand French I suggest you read <a href="http://blog.portail-mcse.net/index.php?post/2008/07/16/Mise-en-place-de-groupes-restreints-dans-une-infrastructure-Active-Directory">Jonathan&#8217;s</a> post on the Portail MCSE blog. If you only understand English you will find a description <a href="http://www.windowsecurity.com/articles/Using-Restricted-Groups.html">here</a>. You can use the <a href="http://support.microsoft.com/kb/279301/en-us"><em>&#8220;Members&#8221;</em></a> portion of restricted group policy, which we will call <em><b>&#8220;replace mode restricted group policy&#8221;</em></b> or the <a href="http://support.microsoft.com/kb/279301/en-us"><em>&#8220;Member Of&#8221;</em></a> portion of restricted group policy, which we will call <em><b>&#8220;add mode restricted group policy&#8221;</em></b>. This feature is <a href="http://support.microsoft.com/kb/810076/en-us">supported</a> on Windows 2000 SP4 and later versions.</p>
<p>In this article we will focus on setting up a replace mode restricted group policy that modifies the local administrator and power users group on our workstations.<br />
<span id="more-508"></span><br />
Setting up this kind of GPO requires making an inventory of your computers: You have to know precisely which users have elevated rights on their PCs. Taking away these rights overnight might cause tension, in addition to technical problems that will occur&#8230; In order to retrieve users with those privileges you can use the trial version of <a href="http://www.systemtools.com/exporter/index.html">Exporter Pro</a> for 30 days, you can also use the command line <a href="http://www.systemtools.com/free.htm">freeware version</a>, or you can set up your own <a href="http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/localgroups/#EnumLocalUser.htm">inventory script</a>. </p>
<p>Once you have a complete list of the domain users which have local administrator or power user privileges on their workstation you have to know why:</p>
<ul>
<li>Political reasons: That&#8217;s the way it is and it won&#8217;t change&#8230; You will not apply the replace mode restricted group policy on his workstation, you will apply the add mode restricted group policy.</li>
<li>A Software installed on the PC needs elevated rights to run correctly.</li>
<li>No particular reason : The replace mode restricted group policy will be applied on this workstation.</li>
</ul>
<p>The second scenario is the one that needs an investigation: Usually an application does not need to have elevated rights to run properly, you just need to grant write permission on some folders, files and registry keys.</p>
<p>Our job will be to identify objects on which you need to grant write permissions for our application to run: The first thing to do is ask the software company, they certainly have this kind of information. Otherwise we will have to track files and registry keys our program tries to access by using <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor</a>. We will show how to perform this operation by studying Tun Plus 10.0.1 developed by <a href="http://www.esker.fr/solutions_host_access/tun_plus.asp">Esker</a>.</p>
<p>This application runs after the user logs on, the command <em>&#8220;C:\Program Files\TUN\tcpw\walld32.exe -h&#8221;</em> is launched. When you log on with a standard user account you have this error message:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/tune1.jpg" rel="lightbox[508]"><img class="aligncenter size-medium wp-image-489" title="tun plus" src="http://www.ldap389.info/wp-content/uploads/2010/05/tune1-300x97.jpg" alt="" width="300" height="97" /></a></p>
<p>We will identify what folders, files and registry keys the walld32.exe needs to have write access on. In your standard user session <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true"><em>runas</em></a> a local administrator the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"><em>procmon.exe</em></a> program. Start the capture, launch the <em>walld32.exe -h</em> and the error message should be displayed, stop the Process Monitor capture. Create a filter in order to retrieve denied access of the process walld32.exe:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/process-monitor.jpg" rel="lightbox[508]"><img class="aligncenter size-medium wp-image-490" title="process-monitor" src="http://www.ldap389.info/wp-content/uploads/2010/05/process-monitor-300x180.jpg" alt="" width="300" height="180"/></a></p>
<p>Our standard user account is trying to write on the following registry keys and folders:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/process-monitor-registry1.jpg" rel="lightbox[508]"><img class="aligncenter size-medium wp-image-493" title="process-monitor-registry" src="http://www.ldap389.info/wp-content/uploads/2010/05/process-monitor-registry1-300x54.jpg" alt="" width="300" height="54" /></a></p>
<p>On the workstations where the Tun Plus software is installed you have to grant standard users the appropriate rights on the registry keys and folder. Before applying the replace mode restricted group policy you have to create a GPO that grants standard users <a href = "http://technet.microsoft.com/en-us/library/cc756952 (WS.10). Aspx">the necessary rights on their computers</a>. If your Tun Plus computers are located in the same OU as other computer objects you will need to apply <a href="http://blogs. technet.com/grouppolicy/archive/2009/07/30/security-filtering-wmi-filtering-and-item-level-targeting-in-group-policy-preferences.aspx">security filtering</a> so as not to grant the privileges on other workstations.</p>
<p>Rather than granting rights on the file system or registry to a user, you can also elevate privileges for an application (i.e. one or more processes) by using <a href="http://www.scriptlogic.com/products/privilegeauthority/?elq=65359eac41e14ae5b942dc02d31d2c3e"> Privilege Authority </a> edited by ScriptLogic.</p>
<p>Once you are done with this application inventory you can apply the replace mode restricted groups policy to almost all your computers. However you must ensure one last thing: That your users are owners of their profile. If the local administrators group owns the profile, former members of the administrator group downgraded to standard users may be surprised, as described in  <a href = "http://blog.portail-mcse.net/index.php?post/2008/07/16/Mise-en-place-de-groupes-restreints-dans-une-infrastructure-Active-Directory "> Jonathan&#8217;s </a> post.</p>
<p>For the users that will retain elevated privileges on their workstations we will apply the add mode restricted group policy. Here is a screenshot of the replace and add mode GPOs: </p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/05/gporestricted2.jpg" rel="lightbox[508]"><br />
<img class="aligncenter size-medium wp-image-497" title="gpo restricted groups" src="http://www.ldap389.info/wp-content/uploads/2010/05/gporestricted2-300x178.jpg" alt="" width="300" height="178" /></a></p>
<p>You can change these GPOs to match your needs, you can add some local groups (e.g. Print Operators&#8230;), and choose the GPO mode you want to apply.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/-zU_0BbgfiY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/05/12/restricted-groups-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/05/12/restricted-groups-policy/</feedburner:origLink></item>
		<item>
		<title>Security and windows autologon</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/uZ9I7-19g0Y/</link>
		<comments>http://www.ldap389.info/en/2010/05/09/security-windows-autologon-workstation/#comments</comments>
		<pubDate>Sun, 09 May 2010 18:48:01 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[adm @en]]></category>
		<category><![CDATA[login @en]]></category>
		<category><![CDATA[vbs @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=475</guid>
		<description><![CDATA[We will describe in this post how to secure your autologon workstations. Those PCs are accessed by everyone inside your company because no account and password are required to login.This is why you need to work out how to secure them. The autologon workstation uses a service user account to open a windows session, the [...]]]></description>
			<content:encoded><![CDATA[<p>We will describe in this post how to secure your autologon workstations. Those PCs are accessed by everyone inside your company because no account and password are required to login.This is why you need to work out how to secure them.</p>
<p>The autologon workstation uses a service user account to open a windows session, the most obvious way to set up an autologon on a workstation is to <a href="http://support.microsoft.com/kb/315231"> edit registry keys. </a> This method is not secure because the account credentials appear in clear text in the registry, meaning that the account can easily be used for other purpose.<br />
<span id="more-475"></span><br />
In order to hide the password we will use the<a href="http://technet.microsoft.com/en-us/sysinternals/bb963905.aspx"> Autologon.exe</a> tool developed by Sysinternals. This program uses the <em><a href="http://msdn.microsoft.com/en-us/library/aa378826.aspx"> LSAStorePrivateData </a></em> function in order to protect the password. This solution is  less vulnerable than others, though not perfect. Have a look at this <a href="http://www.logonexpert.com/freeautologon.html"> article </a> which lists the free autologon solutions available.</p>
<p>We will now describe how to set up and automate the deployment of such workstations by following these steps: Create and configure service user and computer accounts in AD, customize service user accounts profiles, join workstations to the domain, apply restrictive GPOs to our computers and service user accounts and finally activate autologon on the workstations.</p>
<p>To achieve the first step we will use a script, fill in the file <em>input.txt</em> by writing on each line the name of the computer accounts to create. The service user account name will be prefixed with <em>&#8220;s-&#8221; </em> then the computer account name. You will need to change values at the beginning of the script in order to suit your environment:</p>
<ul>
<li> OUComputers: The Organizational Unit<em> Distinguished Name</em> where you want to create your computer accounts. Put these accounts in a dedicated OU because we will apply a very restrictive GPO on these workstations. If you don&#8217;t want to or cannot isolate these accounts you will need to apply a <a href="http://thelazyadmin.com/blogs/thelazyadmin/archive/2006/08/01/Group-Policy-Security-Filtering.aspx"> security filter </a>to the GPO in order not to impact other workstations or servers inside the OU. You can set up security filtering by creating a group of computer accounts and apply the GPO to this group only.</li>
<li> OUUsers: The OU <em>Distinguished Name </em>where you want to create your service user accounts.</li>
<li> DomainFQDN: Your domain<em> FQDN</em>. </ li>
<li> DomainName: Your domain<em> NetBios Name </em>. </ li>
<li> DNGroup: Group<em> Distinguished Name</em> your service user accounts should be members of. You can adapt the script to put service user accounts in several groups or none. Or change it in order to put the computer accounts into a group in order to achieve a group policy security filtering. </li>
<li> ProfileServerPath: Service user accounts will have <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/userprofile_overview.mspx?mfr=true"> roaming profiles </a> that will also become  <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/userprofile_overview.mspx?mfr=true"> mandatory </a> via GPO. We will edit the<em> profilepath</em> account value in order to host the profiles on a network share</li>
</ul>
<p>Here is the script:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'## debut script###
</span>OUComputers = <span style="color: #800000;">&quot;OU=Autologon-Computers,DC=ldap389,DC=info&quot;</span>
OUUsers = <span style="color: #800000;">&quot;OU=Users-Autologon,DC=ldap389,DC=info&quot;</span>
DomainFQDN = <span style="color: #800000;">&quot;ldap389.info&quot;</span>
DomainName = <span style="color: #800000;">&quot;ldap389&quot;</span>
DNGroup = <span style="color: #800000;">&quot;CN=GroupAutologon,OU=Groups,DC=ldap389,DC=info&quot;</span>
ProfileServerPath = <span style="color: #800000;">&quot;ServerNameProfiles&quot;</span>
&nbsp;
<span style="color: #000080;">Const</span> ForReading = 1
<span style="color: #000080;">Const</span> ADS_PROPERTY_APPEND = 3
<span style="color: #000080;">Const</span> ADS_UF_DONT_EXPIRE_PASSWD = &amp;h10000
<span style="color: #000080;">Const</span> ADS_ACETYPE_ACCESS_DENIED_OBJECT = &amp;H6
<span style="color: #000080;">Const</span> ADS_ACEFLAG_OBJECT_TYPE_PRESENT = &amp;H1
<span style="color: #000080;">Const</span> CHANGE_PASSWORD_GUID = <span style="color: #800000;">&quot;{ab721a53-1e2f-11d0-9819-00aa0040529b}&quot;</span>
<span style="color: #000080;">Const</span> ADS_RIGHT_DS_CONTROL_ACCESS = &amp;H100
&nbsp;
<span style="color: #000080;">Set</span> fso = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
sCurPath = fso.GetAbsolutePathName(<span style="color: #800000;">&quot;.&quot;</span>)
<span style="color: #000080;">Input</span> = sCurPath&amp;<span style="color: #800000;">&quot;input.txt&quot;</span>
<span style="color: #000080;">Output</span> = sCurPath&amp;<span style="color: #800000;">&quot;output.txt&quot;</span>
&nbsp;
<span style="color: #000080;">Set</span> df1 = fso.OpenTextFile(<span style="color: #000080;">Input</span>,ForReading,<span style="color: #000080;">True</span>)
<span style="color: #000080;">Set</span> FLog = fso.CreateTextFile(<span style="color: #000080;">Output</span>)
&nbsp;
<span style="color: #000080;">Do</span> <span style="color: #000080;">while</span> <span style="color: #000080;">Not</span> df1.AtEndOfStream
	varLigne = df1.readline()
<span style="color: #008000;">'Create service account to use for autologon
</span>	Login = <span style="color: #800000;">&quot;s-&quot;</span>&amp;varLigne
	<span style="color: #000080;">Set</span> objOU = GetObject(<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;OUUsers)
	<span style="color: #000080;">Set</span> objUser = objOU.Create(<span style="color: #800000;">&quot;User&quot;</span>, <span style="color: #800000;">&quot;cn=&quot;</span>&amp;Login)
	objUser.Put <span style="color: #800000;">&quot;sAMAccountName&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>&amp;Login
	objUser.Put <span style="color: #800000;">&quot;UserPrincipalName&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>&amp; Login &amp;<span style="color: #800000;">&quot;@&quot;</span>&amp;DomainFQDN
	objUser.Put <span style="color: #800000;">&quot;sn&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>&amp;Login
	objUser.Put <span style="color: #800000;">&quot;givenname&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>&amp;Login
	objUser.Put <span style="color: #800000;">&quot;description&quot;</span>, <span style="color: #800000;">&quot;Autologon account: &quot;</span>&amp;varLigne
	objUser.Put <span style="color: #800000;">&quot;Profilepath&quot;</span>, ProfileServerPath&amp;<span style="color: #800000;">&quot;&quot;</span>&amp;Login
	objUser.SetInfo
<span style="color: #008000;">'Generate password, use function of your choice, you can use http://www.tek-tips.com/faqs.cfm?fid=5340 by Mark D. MacLachlan
</span>	pwd = generatePassword(15)
	objuser.SetPassword <span style="color: #800000;">&quot;&quot;</span>&amp; pwd
	objUser.AccountDisabled=<span style="color: #000080;">False</span>
	objUser.SetInfo
&nbsp;
&nbsp;
<span style="color: #008000;">'Set password never expires
</span>intUAC = objUser.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;userAccountControl&quot;</span>)
&nbsp;
<span style="color: #000080;">If</span> ADS_UF_DONT_EXPIRE_PASSWD <span style="color: #000080;">AND</span> intUAC <span style="color: #000080;">Then</span>
    Wscript.Echo <span style="color: #800000;">&quot;Already enabled&quot;</span>
<span style="color: #000080;">Else</span>
    objUser.Put <span style="color: #800000;">&quot;userAccountControl&quot;</span>, intUAC <span style="color: #000080;">XOR</span> _
        ADS_UF_DONT_EXPIRE_PASSWD
    objUser.SetInfo
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
<span style="color: #008000;">' Set user cannot change password
</span><span style="color: #000080;">Set</span> objSD = objUser.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;ntSecurityDescriptor&quot;</span>)
<span style="color: #000080;">Set</span> objDACL = objSD.DiscretionaryAcl
arrTrustees = array(<span style="color: #800000;">&quot;nt authorityself&quot;</span>, <span style="color: #800000;">&quot;EVERYONE&quot;</span>)
&nbsp;
<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> strTrustee <span style="color: #000080;">in</span> arrTrustees
    <span style="color: #000080;">Set</span> objACE = CreateObject(<span style="color: #800000;">&quot;AccessControlEntry&quot;</span>)
    objACE.Trustee = strTrustee
    objACE.AceFlags = 0
    objACE.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT
    objACE.Flags = ADS_ACEFLAG_OBJECT_TYPE_PRESENT
    objACE.ObjectType = CHANGE_PASSWORD_GUID
    objACE.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS
    objDACL.AddAce objACE
<span style="color: #000080;">Next</span>
&nbsp;
objSD.DiscretionaryAcl = objDACL
objUser.Put <span style="color: #800000;">&quot;nTSecurityDescriptor&quot;</span>, objSD
objUser. SetInfo
&nbsp;
&nbsp;
&nbsp;
<span style="color: #008000;">'Generate command to run autogon.exe on workstation	
</span>
	Flog.writeline(<span style="color: #800000;">&quot;autologon.exe &quot;</span>&amp;Login&amp;<span style="color: #800000;">&quot; &quot;</span>&amp;DomainName&amp;<span style="color: #800000;">&quot; &quot;</span>&amp;pwd)
&nbsp;
<span style="color: #008000;">'Add user created to the group DNGroup
</span>
	<span style="color: #000080;">Set</span> objGroup1 = GetObject(<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;DNGroup)
	objGroup1.PutEx ADS_PROPERTY_APPEND, <span style="color: #800000;">&quot;member&quot;</span>, Array(<span style="color: #800000;">&quot;cn=&quot;</span>&amp;Login&amp;<span style="color: #800000;">&quot;,&quot;</span>&amp;OUUsers)
	objGroup1.SetInfo
&nbsp;
<span style="color: #008000;">'Create computer account
</span>	<span style="color: #000080;">Set</span> objOU2 = GetObject(<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;OUComputers)
	<span style="color: #000080;">Set</span> objCpu = objOU2.Create(<span style="color: #800000;">&quot;Computer&quot;</span>, <span style="color: #800000;">&quot;cn=&quot;</span>&amp;varLigne)
	objCpu.Put <span style="color: #800000;">&quot;sAMAccountName&quot;</span>, varLigne &amp; <span style="color: #800000;">&quot;$&quot;</span>
	objCpu.Put <span style="color: #800000;">&quot;userAccountControl&quot;</span>, 4096
	objCpu.Put <span style="color: #800000;">&quot;description&quot;</span>, <span style="color: #800000;">&quot;Autologon workstation&quot;</span>
	objCpu.Setinfo
	<span style="color: #000080;">Loop</span>
&nbsp;
df1.<span style="color: #000080;">close</span>
&nbsp;
msgbox <span style="color: #800000;">&quot;OK&quot;</span>
WScript.Quit
&nbsp;
<span style="color: #000080;">Function</span> generatePassword(PASSWORD_LENGTH)
<span style="color: #008000;">'......................
</span><span style="color: #000080;">End</span> <span style="color: #000080;">Function</span>
&nbsp;
'## fin script###</pre></div></div>

<p>Download script here:</p>
<p>Pour télécharger le script c&#8217;est ici:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/Autologon.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>In order to randomize the service user account password we use <a href="http://www.tek-tips.com/faqs.cfm?fid=5340">Mark D. MacLachlan&#8217;s</a> function the same way as in my <a href="/?p=418">previous post</a>. You can also decide to input the same password for each account. The accounts are flagged <em>&#8220;User cannot change password&#8221;</em> and <em>&#8220;The password never expires&#8221;</em> because if the password changes you will need to configure your workstation again with the autologon.exe program. The <em>output.txt</em> file contains command line instructions you should run on your workstations to set up autologon with <a href = "http://technet.microsoft.com/en-us/sysinternals/bb963905.aspx"> Sysinternals tool</a>. We will use this file later.</p>
<p>Now you need to configure your user accounts roaming profiles by <a href="http://support.microsoft.com/kb/314478/en-us">copying it from an existing profile</a> template.</p>
<p>Then, having created computer accounts with the above script, join your workstations to the domain.</p>
<p>Create and Link a GPO to the OU where are located the computer accounts, if necessary apply group policy security filtering. On those workstations we need to modify the user environment in order to secure them. In order to apply user settings on a computer object we use the <em><a href="http://support.microsoft.com/kb/231287/en-us">Group Policy loopback</a></em> feature.</p>
<p>Under Active Directory 2003 some registry settings cannot be edited through default <a href="http://support.microsoft.com/kb/816662/en-us">administrative templates</a>, therefore you have to create custom ADM files, I suggest you read this <a href = "http://www.microsoft.com/downloads/details.aspx?FamilyID=e7d72fa1-62fe-4358-8360-8774ea8db847&#038;displaylang=en">document</a>, which explains all of the details for registry-based Group Policy. You can also use the reg2adm tool embedded in the <a href = "http://yizhar.mvps.org/"> Network UTilities Suite </a> developed by Yizhar Hurwitz.</p>
<p>Under Active Directory 2008 thanks to <em><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=42e30e3f-6f01-4610-9d6e-f6e0fb7a0790&#038;displaylang=en">Group Policy Preferences</a></em> editing a registry key is more simple (read page 10 of the whitepaper).</p>
<p>We will use <a href="http://support.microsoft.com/kb/555324">Simon Geary&#8217;s</a> custom administrative template in order to disable USB, CD drives on the autologon workstations.</p>
<p>In order to make preconfigured roaming profiles <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/userprofile_overview.mspx?mfr=true">mandatory</a> we will <a href="http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/7df7635e-2816-41e3-a912-ffc2eab5f146">enable this setting</a> on the GPO:<em>&#8220;Prevent Roaming Profile changes from being propagated to the server&#8221;</em>.</p>
<p>Several restrictive settings are applied to the GPO, this list is not exhaustive, you can add or delete settings at your convenience:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/04/gporestrict.jpg" rel="lightbox[475]"><img class="aligncenter size-medium wp-image-455" title="gpo autologon" src="http://www.ldap389.info/wp-content/uploads/2010/04/gporestrict-131x300.jpg" alt="" width="131" height="300" /></a></p>
<p>Finally in order to activate the autologon on the workstations, you need to run the appropriate command line which is provided in the <em>output.txt</em> file on each computer.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/uZ9I7-19g0Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/05/09/security-windows-autologon-workstation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/05/09/security-windows-autologon-workstation/</feedburner:origLink></item>
		<item>
		<title>Generic accounts security</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/HX9OsDwCIiA/</link>
		<comments>http://www.ldap389.info/en/2010/04/18/generic-accounts-security/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 18:09:02 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[login @en]]></category>
		<category><![CDATA[vbs @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=436</guid>
		<description><![CDATA[The title of this post seems a bit contradictory, the use of generic accounts in your domain should be limited to the minimum. Access to your domain ressources should be done with nominative accounts when possible, that&#8217;s why you want to avoid generic accouns use. However for political or historical reasons a department of your [...]]]></description>
			<content:encoded><![CDATA[<p>The title of this post seems a bit contradictory, the use of generic accounts in your domain should be limited to the minimum. Access to your domain ressources should be done with nominative accounts when possible, that&#8217;s why you want to avoid generic accouns use. However for political or historical reasons a department of your company might use this type of accounts to access some applications or log on some computers. This account is used by several persons, accordingly the password does not remain secret and across many departments, non-authorized persons might know it and use it for other purposes. If you set up a classic change password policy for this account, then when the password expires, a single person will change it and will probably not notify other users that are entitled to use the account of the new password. That&#8217;s why generic accounts are generally flagged <a href="http://technet.microsoft.com/en-us/library/ee198831.aspx">&#8220;the password never expires&#8221;</a>, which is an obvious lack of security. We will demonstrate in this post how to set up an automatic system that will change the password and notify users entitled to use the account.<br />
<span id="more-436"></span></p>
<p>We will implement a scheduled task, launched with a service account that is granted the sufficient permissions to change our generic account password, that will proceed to change the password and notify the users that are entitled to use the account. This task will run monthly if you want to change the password every month.</p>
<p>First we have to make some modifications on the generic account:</p>
<ul>
<li>Leave the <a href="http://technet.microsoft.com/en-us/library/ee198831.aspx">flag</a> &#8220;passsword never expires&#8221;: The password will be changed when our task runs and not when our Default Domain Password Policy (under Windows 2003) or our <a href="http://technet.microsoft.com/en-us/library/cc770394(WS.10).aspx"><em>&#8220;Fine Grained Password Policies&#8221;</em> </a> (under Windows 2008) requires it.</li>
<li>Enable the <a href="http://technet.microsoft.com/en-us/library/ee198831.aspx">flag</a> &#8220;User cannot change password&#8221;: Password will only be changed by our service account running the scheduled task or by AD administrators.</li>
<li>Allow the service account to change the generic account&#8217;s password.</li>
</ul>
<p>Have a look at the following screenshots, <em>s-pwd-supervision</em> is the service account that will run the scheduled task and <em>g-generic</em> is the generic account.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/04/generic-account.jpg" rel="lightbox[436]"><img class="aligncenter size-medium wp-image-421" title="generic-account" src="http://www.ldap389.info/wp-content/uploads/2010/04/generic-account-300x166.jpg" alt="" width="300" height="166" /></a></p>
<p>We need to create the scheduled task: The script <em>changepass.vbs</em> will be launched every 1st of the month at 5 am by our service account <em>s-pwd-supervision</em>:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/04/schedtask.jpg" rel="lightbox[436]"><img class="aligncenter size-medium wp-image-422" title="schedtask" src="http://www.ldap389.info/wp-content/uploads/2010/04/schedtask-300x146.jpg" alt="" width="300" height="146" /></a></p>
<p>We will now show what is in the script <em>changepass.vbs, </em>first we need to generate a random password and then attribute it to the generic account <em>g-generic. </em>The password generator function was copied from this <a href="http://www.tek-tips.com/faqs.cfm?fid=5340">page</a>,the author is <a href="http://www.thespidersparlor.com">Mark D. MacLachlan</a>, You can find some other functions on the Web. You have to change the <em>DNg-generic</em> value that is the generic account <em>Distinguished Name</em>. &#8220;GeneratePassword&#8221; function is set up to generate an 8 character long password, you can change this value, as long as you meet your password length policy requirements.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">DNg-generic = <span style="color: #800000;">&quot;CN=g-generic,OU=users,DC=ldap389,DC=info&quot;</span>
&nbsp;
pwd = generatePassword(8)
&nbsp;
<span style="color: #000080;">Set</span> objUser = GetObject(<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;DNg-generic)
&nbsp;
objUser.SetPassword pwd
&nbsp;
<span style="color: #000080;">Function</span> generatePassword(PASSWORD_LENGTH)
&nbsp;
<span style="color: #000080;">Dim</span> NUMLOWER, NUMUPPER, LOWERBOUND, UPPERBOUND, LOWERBOUND1, UPPERBOUND1, SYMLOWER, SYMUPPER
<span style="color: #000080;">Dim</span> newPassword, count, pwd
<span style="color: #000080;">Dim</span> pCheckComplex, pCheckComplexUp, pCheckComplexLow, pCheckComplexNum, pCheckComplexSym, pCheckAnswer
&nbsp;
 NUMLOWER    = 48  <span style="color: #008000;">' 48 = 0
</span> NUMUPPER    = 57  <span style="color: #008000;">' 57 = 9
</span> LOWERBOUND  = 65  <span style="color: #008000;">' 65 = A
</span> UPPERBOUND  = 90  <span style="color: #008000;">' 90 = Z
</span> LOWERBOUND1 = 97  <span style="color: #008000;">' 97 = a
</span> UPPERBOUND1 = 122 <span style="color: #008000;">' 122 = z
</span> SYMLOWER    = 33  <span style="color: #008000;">' 33 = !a
</span> SYMUPPER    = 46  <span style="color: #008000;">' 46 = .
</span> pCheckComplexUp  = 0 <span style="color: #008000;">' used later to check number of character types in password
</span> pCheckComplexLow = 0 <span style="color: #008000;">' used later to check number of character types in password
</span> pCheckComplexNum = 0 <span style="color: #008000;">' used later to check number of character types in password
</span> pCheckComplexSym = 0 <span style="color: #008000;">' used later to check number of character types in password
</span>
 <span style="color: #008000;">' initialize the random number generator
</span> Randomize()
&nbsp;
 newPassword = <span style="color: #800000;">&quot;&quot;</span>
 count = 0
 <span style="color: #000080;">DO</span> <span style="color: #000080;">UNTIL</span> count = PASSWORD_LENGTH
   <span style="color: #008000;">' generate a num between 2 and 10
</span>
 <span style="color: #008000;">' if num &amp;lt;= 2 create a symbol
</span>   <span style="color: #000080;">If</span> Int( ( 10 - 2 + 1 ) * Rnd + 2 ) &amp;lt;= 2 <span style="color: #000080;">Then</span>     pwd = Int( ( SYMUPPER - SYMLOWER + 1 ) * Rnd + SYMLOWER )    <span style="color: #008000;">' if num is between 3 and 5 create a lowercase    Elseif Int( ( 10 - 2 + 1 ) * Rnd + 2 ) &amp;gt; 2 And  Int( ( 10 - 2 + 1 ) * Rnd + 2 ) &amp;lt;= 5 Then     pwd = Int( ( UPPERBOUND1 - LOWERBOUND1 + 1 ) * Rnd + LOWERBOUND1 )     ' if num is 6 or 7 generate an uppercase    Elseif Int( ( 10 - 2 + 1 ) * Rnd + 2 ) &amp;gt; 5 And  Int( ( 10 - 2 + 1 ) * Rnd + 2 ) &amp;lt;= 7 Then     pwd = Int( ( UPPERBOUND - LOWERBOUND + 1 ) * Rnd + LOWERBOUND )    Else        pwd = Int( ( NUMUPPER - NUMLOWER + 1 ) * Rnd + NUMLOWER )    End If   newPassword = newPassword + Chr( pwd )      count = count + 1      'Check to make sure that a proper mix of characters has been created.  If not discard the password.   If count = (PASSWORD_LENGTH) Then       For pCheckComplex = 1 To PASSWORD_LENGTH           'Check for uppercase           If Asc(Mid(newPassword,pCheckComplex,1)) &amp;gt;64 And Asc(Mid(newPassword,pCheckComplex,1))&amp;lt; 90 Then                   pCheckComplexUp = 1           'Check for lowercase           ElseIf Asc(Mid(newPassword,pCheckComplex,1)) &amp;gt;96 And Asc(Mid(newPassword,pCheckComplex,1))&amp;lt; 123 Then                   pCheckComplexLow = 1           'Check for numbers           ElseIf Asc(Mid(newPassword,pCheckComplex,1)) &amp;gt;47 And Asc(Mid(newPassword,pCheckComplex,1))&amp;lt; 58 Then                   pCheckComplexNum = 1           'Check for symbols           ElseIf Asc(Mid(newPassword,pCheckComplex,1)) &amp;gt;32 And Asc(Mid(newPassword,pCheckComplex,1))&amp;lt; 47 Then
</span>                  pCheckComplexSym = 1
          <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
      <span style="color: #000080;">Next</span>
&nbsp;
      <span style="color: #008000;">'Add up the number of character sets.  We require 3 or 4 for a complex password.
</span>      pCheckAnswer = pCheckComplexUp+pCheckComplexLow+pCheckComplexNum+pCheckComplexSym
&nbsp;
      <span style="color: #000080;">If</span> pCheckAnswer &amp;lt; 3 <span style="color: #000080;">Then</span>
          newPassword = <span style="color: #800000;">&quot;&quot;</span>
          count = 0
      <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
  <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
 <span style="color: #000080;">Loop</span>
<span style="color: #008000;">'The password is good so return it
</span> generatePassword = newPassword
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>We are not done yet, we need to notify the users that are entitled to use the account. For this you can use two methods:</p>
<p>The first is to notify users via Email, for that you can use  <a href="http://www.blat.net/">Blat</a>, <a href="http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm">Bmail</a> or use the <a href="http://blogs.technet.com/heyscriptingguy/archive/2004/11/29/how-can-i-attach-a-file-to-an-email-sent-using-cdo.aspx">CDO</a> object in your script. You just need to input SMTP server, recipients and the password in the text body of your Email.</p>
<p>The second one is to publish the password on a Web page with an IIS server. Once the password is generated and attributed to our generic account, it will be written in an HTML file located in a folder on our IIS server. You should restrict access to this folder, therefore to this Web page, to nominative accounts that are entitled to use this generic account. For that you just need to set up NTFS rights on this folder:</p>
<ul>
<li>Service account running the scheduled task should be granted the write access.</li>
<li>Nominative accounts that are entitled to use this generic account should be able to read the folder content, we will grant read access to a group containing the nominative accounts that should be aware of the password change. If a non-authorized person tries to access the page they will receive a <a href="http://support.microsoft.com/kb/247603/en-us">401.3 HTTP error</a>.</li>
</ul>
<p>Security can be further increased on this page: When authorised persons access it, the page remains blank. The user must place the cursor on a particular point on the page for the password to show up. This is done using the Javascript function <em><a href="http://www.htmlgoodies.com/beyond/javascript/article.php/3470771">OnMouseOver</a>. </em> Once your password has been generated by the script, simply add the following lines to your code:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">&nbsp;
<span style="color: #008000;">'PathIISHTML is the path of your HTML file on your IIS Server
</span>PathIISHTML = <span style="color: #800000;">&quot;IISserverShareNameFile.html&quot;</span>
<span style="color: #000080;">Const</span> ForWriting = 2
<span style="color: #000080;">Set</span> FSO = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
<span style="color: #000080;">Set</span> f3 = fso.OpenTextFile(PathIISHTML,ForWriting,1)
&nbsp;
f3.writeline(<span style="color: #800000;">&quot;&lt;div id='myText' style='visibility: hidden'&gt;&quot;</span>&amp;pwd&amp;<span style="color: #800000;">&quot;&lt;/div&gt;&quot;</span>)
f3.writeline(<span style="color: #800000;">&quot;&lt;p onMouseOver=&quot;</span>&amp;chr(34)&amp;<span style="color: #800000;">&quot;myText.style.visibility = 'visible'&quot;</span>&amp;chr(34))
f3.writeline(<span style="color: #800000;">&quot;onMouseOut=&quot;</span>&amp;chr(34)&amp;<span style="color: #800000;">&quot;myText.style.visibility = 'hidden'&quot;</span>&amp;chr(34)&amp;<span style="color: #800000;">&quot;&gt;&quot;</span>)
f3.writeline(<span style="color: #800000;">&quot;&lt;BR&gt;&quot;</span>)
f3.writeline(<span style="color: #800000;">&quot;&lt;/p&gt;&quot;</span>)
f3.<span style="color: #000080;">close</span></pre></div></div>

<p>Download the full sample script here:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/genericuserpwd.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>You will notice that with this type of code it is very simple to generate a HTML page. It can be used in other scripts to present reports a little more clearly than with simple text files.<br />
A final remark: Before setting up a change of password for a generic account, ensure that it is not being used by a scheduled task, autologon workstation or windows service.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/HX9OsDwCIiA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/04/18/generic-accounts-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/04/18/generic-accounts-security/</feedburner:origLink></item>
		<item>
		<title>Monitor GPO Links modifications</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/Yw_SF45RfZE/</link>
		<comments>http://www.ldap389.info/en/2010/04/07/monitor-gpo-links-modifications/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 22:00:38 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[tools @en]]></category>
		<category><![CDATA[gplink @en]]></category>
		<category><![CDATA[vbs @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=387</guid>
		<description><![CDATA[You can track GPO links changes by analyzing the security eventlog, GPO links will give you information on which objects your GPO is applied to. We will monitor GPLink attribute changes. In order to analyze in real time the security log of all your DCs you need to pay for a Syslog solution, like Snare [...]]]></description>
			<content:encoded><![CDATA[<p>You can track GPO links changes by analyzing the security eventlog, GPO links will give you information on which objects your GPO is applied to. We will monitor <a href="http://msdn.microsoft.com/en-us/library/cc232505(PROT.13).aspx">GPLink</a> attribute changes.</p>
<p>In order to analyze in real time the security log of all your DCs you need to pay for a Syslog solution, like Snare or Kiwi. Or you can try to setup <a href="http://blogs.technet.com/otto/archive/2008/07/08/quick-and-dirty-enterprise-eventing-for-windows.aspx"> an eventlog forwarding</a> solution if you are under Windows 2008, you can also try to run a <a href="http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/logs/eventlogs/#AsyncEventLog.htm">script</a> that catches security log events, but you might encounter some performance issues.<br />
<span id="more-387"></span><br />
We noticed in last post that the GPLink attribute was already set up in <a href="http://technet.microsoft.com/en-us/library/cc773209(WS.10).aspx">default audit settings</a>. We will have a closer look at this attribute with <a href="http://technet.microsoft.com/en-us/library/cc773354(WS.10).aspx">adsiedit.msc</a>:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/adsiedit1.jpeg" rel="lightbox" title="adsiedit"><img class="aligncenter size-medium wp-image-353" title="adsiedit" src="http://www.ldap389.info/wp-content/uploads/2010/03/adsiedit1-300x262.jpg" alt="" width="300" height="262" /></a></p>
<p>GPLink has the following structure <em>[LDAP://CN={31F5F311-013D-11D2-125F-00D04F0E84F9},CN=Policies,CN=System,DC=ldap389,DC=info;0][LDAP://CN={31F5F311-0187-EFD2-345F-BED04F1284F9},CN=Policies,CN=System,DC=ldap389,DC=info;2]</em>, each GPO linked to the OU/Site/Domain is separated with <em>&#8220;[]&#8220;</em>, between the brackets there are two data that are separated with a <em>;</em> : The GPO Distinguished Name and how this GPO is applied, a number between 0 and 3:</p>
<ul>
<li>0: GPO enabled, not enforced</li>
<li>1: GPO disabled, not enforced</li>
<li>2: GPO enabled and enforced</li>
<li>3: GPO disabled and enforced</li>
</ul>
<p>You can retrieve GPLink information described above by using the following <a href="http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/ous/#ReturnGPOInfo.htm">script</a>. We now need to monitor the security log to catch GPLink modifications in real time:</p>
<p>Under Windows 2003 Event ID <a href="http://www.eventid.net/display.asp?eventid=566&#038;eventno=4015&#038;source=Security&#038;phase=1">566</a> is created in security log when you modify  an audited attribute. The problem is that you do not have information about the value of the attribute before and after the modification.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/gpling2003.jpg" rel="lightbox" title="gplink-security-envent-2003"><img class="aligncenter size-medium wp-image-354" title="gplink2003" src="http://www.ldap389.info/wp-content/uploads/2010/03/gpling2003-257x300.jpg" alt="" width="257" height="300" /></a>,</p>
<p>You have the following information: Who modified the GPO link, on which DC and the Distinguished Name of the OU/Site/Domain modified. If you want to get the GPLink value after modification, you just need to do an LDAP query on the DC where the modification occurred. To retrieve the GPLink value before modification you need a lag site, Microsoft does not support delayed replication DC if you use it for a <a href="http://technet.microsoft.com/en-us/library/dd835581(WS.10).aspx">disaster recovery plan</a>, but you can use a lag site in this context: We just use it to retrieve information before modification. Then we just need to compare data after and before modification to know which GPO link was modified.</p>
<p>Under Windows 2008 you do not need a lag site, you have the before and after value of the modified attribute in the security log, you just need to activate <a href="http://technet.microsoft.com/en-us/library/cc731607(WS.10).aspx">AD auditing</a> on your DC. Event ID is <a href="http://www.eventid.net/display.asp?eventid=5136&#038;eventno=10591&#038;source=Microsoft-Windows-Security-Auditing&#038;phase=1">5136</a>, value before modification is in the event where operation equals <em>value deleted</em>, value after modification is in the event where operation equals <em>value added</em></p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/gplinlenevt2008.jpg" rel="lightbox" title="gplink-security-envent-5136"><img class="aligncenter size-medium wp-image-356" title="gplink-security-envent-5136" src="http://www.ldap389.info/wp-content/uploads/2010/03/gplinlenevt2008-300x133.jpg" alt="" width="300" height="133" /></a></p>
<p>If you create your first GPO Link on an object (e.g. OU/Site/Domain) value before modification will be void, value after modification equals the new GPlink. If you delete the last GPLink on an object value before modification equals the single GPLink and value after modification is void. If you are monitoring GPO Links on a Windows 2003 environment it will be a bit more complex: If you create you first GPO Link on a object, the LDAP request on the lag site will return an error code, because value doesn&#8217;t exist, so you have to handle error codes in your LDAP requests. It&#8217;s the same when you delete last GPLink, you have to handle the error code returned by your LDAP request made on the DC where the deletion occurred.</p>
<p>Depending on the OS version of your DC you need to <a href="http://www.intersectalliance.com/resources/Documentation/Guide_to_Snare_for_Windows-2.8.pdf">set up your Snare Agents</a> in order to catch event IDs 566 or 5136 in security log, you can of course use other Syslog Softwares. In our infrastructure the application collecting Snare agents data is Kiwi. We noticed that some values were not logged with friendly names, especially the <em>Distinguished Name</em> of the OU/Site/Domain on which the modification happened. This information was logged with the GUID string value of the object, if you want to get the friendly name (DN) you need to use this <a href="http://support.microsoft.com/kb/325648">script provided by MS</a>. There is a little error in this KB article, the function name is not correct, you should replace the penultimate line by <em>&#8220;ConvertStringGUIDToHexStringGUID = octetStr&#8221;.</em></p>
<p>We will now show how to compare GPLink value before modification and after modification in order to be aware of GPO Links modifications. As already discussed a GPLink has two parts: Distinguished Name of GPO, and a numeric value that tells us how GPO is applied. Here are the differents cases: </p>
<ul>
<li>GPLink value before [DNGPO1;0][DNGPO2;3] and GPLink value after [DNGPO1;0][DNGPO2;3][DNGPO3;2] a new enforced link was created.</li>
<li>GPLink value before [DNGPO1;0][DNGPO2;3] and GPLink value after [DNGPO1;0] Link of DNGPO2 has been deleted on our OU/Site/Domain.</li>
<li>GPLink value before [DNGPO1;0][DNGPO2;3] and GPLink value after [DNGPO1;1][DNGPO2;3] Link of DNGPO1 was disabled (but not deleted).</li>
<li>GPLink value before [DNGPO1;0][DNGPO2;3] and GPLink value after [DNGPO1;0][DNGPO2;2] Link of DNGPO2 was enabled and is still enforced.</li>
<li>etc&#8230;</li>
</ul>
<p>In order to compare data before and after we will use <a href="http://technet.microsoft.com/en-us/library/ee176993.aspx"><em>dictionary objects.</em></a> We create two dictionaries, one with data before modification and a second with data after modification. The dictionaries keys will be the GPOs <em>Distinguished Names</em> and dictionaries values will be the numeric values between 0 and 3. Here is how two create both dictionaries:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'After modification GPLink dicitonnary
</span><span style="color: #000080;">Set</span> GPLinkdict = CreateObject(<span style="color: #800000;">&quot;Scripting.Dictionary&quot;</span>)
<span style="color: #008000;">'Before modification GPLink dicitonnary
</span><span style="color: #000080;">Set</span> GPLinkdictLAG = CreateObject(<span style="color: #800000;">&quot;Scripting.Dictionary&quot;</span>)
&nbsp;
<span style="color: #008000;">'strGPLinkAfter is the GPLink value after modification, you retrieved it with the event log
</span><span style="color: #008000;">'under Windows 2008 and with an LDAP request on the where DC the modification occurred under Windows 2003
</span>
<span style="color: #000080;">if</span> instr(strGPLinkAfter,<span style="color: #800000;">&quot;]&quot;</span>) &lt;&gt; 0 <span style="color: #000080;">then</span>
OUModifiedGPLINK = split(strGPLinkAfter,<span style="color: #800000;">&quot;]&quot;</span>)
<span style="color: #000080;">For</span> i = <span style="color: #000080;">UBound</span>(OUModifiedGPLINK) -1 <span style="color: #000080;">to</span> <span style="color: #000080;">LBound</span>(OUModifiedGPLINK) <span style="color: #000080;">Step</span> -1
GPOLinkstatus = split(OUModifiedGPLINK(i),<span style="color: #800000;">&quot;;&quot;</span>)
GPLinkdict.add GPOLinkstatus(0),GPOLinkstatus(1)
<span style="color: #000080;">Next</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
&nbsp;
&nbsp;
<span style="color: #008000;">'strGPLink before is the GPLink value before modification, you retrieved it with the event log
</span><span style="color: #008000;">'under Windows 2008 and with an LDAP request on the LAG DC under Windows 2003
</span>
&nbsp;
<span style="color: #000080;">if</span> instr(strGPLinkBefore,<span style="color: #800000;">&quot;]&quot;</span>) &lt;&gt; 0 <span style="color: #000080;">then</span>
OUModifiedGPLINKLAG = split(strGPLinkBefore,<span style="color: #800000;">&quot;]&quot;</span>)
<span style="color: #000080;">For</span> j = <span style="color: #000080;">UBound</span>(OUModifiedGPLINKLAG)-1 <span style="color: #000080;">to</span> <span style="color: #000080;">LBound</span>(OUModifiedGPLINKLAG) <span style="color: #000080;">Step</span> -1
GPOLinkstatusLAG = split(OUModifiedGPLINKLAG(j),<span style="color: #800000;">&quot;;&quot;</span>)
GPLinkdictLAG.add GPOLinkstatusLAG(0),GPOLinkstatusLAG(1)
<span style="color: #000080;">Next</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">if</span></pre></div></div>

<p>Click here to download sample script:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/GPLINK0.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>Now we will read through <em>GPLinkdict</em> dictionary, containing keys and values after modification and compare them to keys and values of the other dictionary. If a key doesn&#8217;t exist in the <em>GPLinkdictLag</em> dictionary, containing keys and values before modification, this means that a GPO Link was just created. If for the same key in both dictionaries the value is different, then the GPO Link was enabled/disabled or the enforce parameter was changed. With this script you can find out when GPO Linkq are created or wether the state of an existing GPO Link has changed:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">&nbsp;
<span style="color: #008000;">'The DC where the modification was recorded, retrieved with eventlog
</span>dcsource = <span style="color: #800000;">&quot;DCSOURCENAME&quot;</span>
&nbsp;
<span style="color: #008000;">'OU/Site/Domain name where GPO Link was modified, retrieved with eventlog
</span>OUName = <span style="color: #800000;">&quot;OUName&quot;</span>
&nbsp;
<span style="color: #008000;">'User who made the modication, retrieved with eventlog
</span>Username = <span style="color: #800000;">&quot;UsernName&quot;</span>
&nbsp;
<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> oGPLinkdict <span style="color: #000080;">in</span> GPLinkdict
	<span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> GPLinkdictLAG.Exists(oGPLinkdict) <span style="color: #000080;">Then</span>
&nbsp;
	<span style="color: #000080;">Set</span> objGPOd = GetObject(split(replace(oGPLinkdict,<span style="color: #800000;">&quot;LDAP://&quot;</span>,<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;dcsource&amp;<span style="color: #800000;">&quot;/&quot;</span>),<span style="color: #800000;">&quot;[&quot;</span>)(1))
	DNobjGPOd = objGPOd.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;DisplayName&quot;</span>)
	Msgbox Username&amp;<span style="color: #800000;">&quot; created a link on this object: &quot;</span>&amp; OUName &amp;<span style="color: #800000;">&quot;  / GPOName: &quot;</span>&amp;DNobjGPOd &amp; <span style="color: #800000;">&quot;  / Link Value: &quot;</span>&amp;GPLinkdict.Item(oGPLinkdict)
&nbsp;
	<span style="color: #000080;">Else</span> 
		<span style="color: #000080;">If</span> GPLinkdictLAG.Item(oGPLinkdict) &lt;&gt; GPLinkdict.Item(oGPLinkdict) <span style="color: #000080;">then</span>
&nbsp;
			<span style="color: #000080;">if</span> (GPLinkdictLAG.Item(oGPLinkdict) = 0 <span style="color: #000080;">OR</span> GPLinkdictLAG.Item(oGPLinkdict) = 2) <span style="color: #000080;">AND</span> (GPLinkdict.Item(oGPLinkdict) =1 <span style="color: #000080;">OR</span> GPLinkdict.Item(oGPLinkdict) = 3) <span style="color: #000080;">then</span>
&nbsp;
			<span style="color: #000080;">Set</span> objGPOd = GetObject(split(replace(oGPLinkdict,<span style="color: #800000;">&quot;LDAP://&quot;</span>,<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;dcsource&amp;<span style="color: #800000;">&quot;/&quot;</span>),<span style="color: #800000;">&quot;[&quot;</span>)(1))
			DNobjGPOd = objGPOd.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;DisplayName&quot;</span>)
			Msgbox Username&amp;<span style="color: #800000;">&quot; disabled a link on this object: &quot;</span>&amp; OUName &amp;<span style="color: #800000;">&quot;  / GPOName: &quot;</span>&amp;DNobjGPOd &amp; <span style="color: #800000;">&quot;  / Link Value Before: &quot;</span>&amp;GPLinkdictLAG.Item(oGPLinkdict)&amp;<span style="color: #800000;">&quot;  / Link Value After: &quot;</span>&amp;GPLinkdict.Item(oGPLinkdict)
&nbsp;
			<span style="color: #000080;">Else</span>
&nbsp;
			<span style="color: #000080;">Set</span> objGPOd = GetObject(split(replace(oGPLinkdict,<span style="color: #800000;">&quot;LDAP://&quot;</span>,<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;dcsource&amp;<span style="color: #800000;">&quot;/&quot;</span>),<span style="color: #800000;">&quot;[&quot;</span>)(1))
			DNobjGPOd = objGPOd.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;DisplayName&quot;</span>)
			Msgbox Username&amp;<span style="color: #800000;">&quot; enabled a link on this object: &quot;</span>&amp; OUName &amp;<span style="color: #800000;">&quot;  / GPOName: &quot;</span>&amp;DNobjGPOd &amp; <span style="color: #800000;">&quot;  / Link Value Before: &quot;</span>&amp;GPLinkdictLAG.Item(oGPLinkdict)&amp;<span style="color: #800000;">&quot;  / Link Value After: &quot;</span>&amp;GPLinkdict.Item(oGPLinkdict)
&nbsp;
			<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
&nbsp;
&nbsp;
		<span style="color: #000080;">End</span> <span style="color: #000080;">if</span> 
	<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">Next</span></pre></div></div>

<p>Click here to download sample script:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/GPLINK1.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>Finally we need to get GPO links that were deleted, for this we will read through the <em>GPLinkdictLag</em> dictionary. If a key doesn&#8217;t exists in the <em>GPLinkdict</em> dictionary then the GPO Link was deleted:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'Enter LAGDC if you have one, it will be useful only in this case : if a Link is deleted and the GPO is deleted from the domain as well at the same time
</span><span style="color: #008000;">'In that case we cannot retrieve GPO Display Name if we do not have lag site.
</span><span style="color: #008000;">'If no lag site then LAGDC = &quot;&quot;
</span>LAGDC = <span style="color: #800000;">&quot;LAGDCNAME&quot;</span>
&nbsp;
<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> oGPLinkdictLAG <span style="color: #000080;">in</span> GPLinkdictLAG
  <span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> GPLinkdict.Exists(oGPLinkdictLAG) <span style="color: #000080;">Then</span>
	err.clear
	<span style="color: #000080;">Set</span> objGPOd = GetObject(split(replace(oGPLinkdictLAG,<span style="color: #800000;">&quot;LDAP://&quot;</span>,<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;dcsource&amp;<span style="color: #800000;">&quot;/&quot;</span>),<span style="color: #800000;">&quot;[&quot;</span>)(1))
	<span style="color: #000080;">if</span> err.number &lt;&gt; 0 <span style="color: #000080;">then</span>
		<span style="color: #000080;">if</span> LAGDC &lt;&gt; <span style="color: #800000;">&quot;&quot;</span> <span style="color: #000080;">then</span>
		<span style="color: #000080;">Set</span> objGPOd = GetObject(split(replace(oGPLinkdict,<span style="color: #800000;">&quot;LDAP://&quot;</span>,<span style="color: #800000;">&quot;LDAP://&quot;</span>&amp;dcsource&amp;<span style="color: #800000;">&quot;/&quot;</span>),<span style="color: #800000;">&quot;[&quot;</span>)(1))
		DNobjGPOd = objGPOd.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;DisplayName&quot;</span>)
		<span style="color: #000080;">Else</span>
		DNobjGPOd = split(oGPLinkdictLAG,<span style="color: #800000;">&quot;[&quot;</span>)(1)
	<span style="color: #000080;">Else</span> 
	DNobjGPOd = objGPOd.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;DisplayName&quot;</span>)
	<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
	Msgbox Username&amp;<span style="color: #800000;">&quot; deleted a link on this object: &quot;</span>&amp; OUName &amp;<span style="color: #800000;">&quot;  / GPOName: &quot;</span>&amp;DNobjGPOd &amp; <span style="color: #800000;">&quot;  / Link Value was: &quot;</span>&amp;GPLinkdictLAG.Item(oGPLinkdict)
  <span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">Next</span></pre></div></div>

<p>Click here to download sample script:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/GPLINK2.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>By following the guidelines described in this post and the <a href="/?p=276">previous one</a> you can build your own GPO monitoring tool. In addition to creating reports you can launch a backup when a GPO is modified as well, by using sample scripts <a href="http://technet.microsoft.com/en-us/library/cc776655%28WS.10%29.aspx">shipped with the GPMC</a>.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/Yw_SF45RfZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/04/07/monitor-gpo-links-modifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/04/07/monitor-gpo-links-modifications/</feedburner:origLink></item>
		<item>
		<title>Track GPO changes: Monitoring GPT</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/hkRJl8lCrF8/</link>
		<comments>http://www.ldap389.info/en/2010/03/31/track-gpo-changes-monitor-gpt/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:39:23 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[tools @en]]></category>
		<category><![CDATA[gpo]]></category>
		<category><![CDATA[sysvol @en]]></category>
		<category><![CDATA[vbs @en]]></category>
		<category><![CDATA[wmi @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=343</guid>
		<description><![CDATA[We will explain in this post how to monitor GPO changes by tracking modifications on the GPT. Only deletion, computer/user configuration modification and creation can be overlooked. About GPO monitoring you can read this article,which shows you how to activate auditing on your Sysvol share \\domainname\sysvol\domainfqdn\Policies and retrieve GPO changes via the eventlog. We will [...]]]></description>
			<content:encoded><![CDATA[<p>We will explain in this post how to monitor GPO changes by tracking modifications on the <a href="http://www.gpoguy.com/FAQs/Whitepapers/tabid/63/articleType/ArticleView/articleId/6/Understanding-Group-Policy-Storage.aspx">GPT</a>. Only deletion, computer/user configuration modification and creation can be overlooked. About GPO monitoring you can read this <a href="http://blogs.msdn.com/ericfitz/archive/2005/08/04/447951.aspx">article</a>,which shows you how to activate auditing on your Sysvol share <em>\\domainname\sysvol\domainfqdn\Policies</em> and retrieve GPO changes via the eventlog. We will use another method, taking advantage of the replication of this folder.<br />
<span id="more-343"></span><br />
When GPOs replicate on your domain, GPT part is replicated with the <a href="http://technet.microsoft.com/en-us/library/cc773238(WS.10).aspx">DFS-R</a> system under Windows 2008 and with the <a href="http://support.microsoft.com/kb/220140">FRS</a> system under Windows 2003 (See migration guide <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=df8e5e84-c6c6-4cef-9dab-304c92299804#tm">here</a>.) The <a href="http://technet.microsoft.com/en-us/library/cc778037(WS.10).aspx">SYSVOL</a> share is modified on every DC when a GPO creation/deletion/configuration modification occurs. So you can control modifications made by administrators on a single DC.</p>
<p>When you create/delete a GPO a folder named <em>\\domainname\sysvol\domainfqdn\Policies\{%GPO_GUID%}</em> is created/deleted. When you modify the computer/user configuration of a GPO the file <em>\\domainname\sysvol\domainfqdn\Policies\{%GPO_GUID%}\gpt.ini</em> is modified, for more information, read this <a href="http://blogs.technet.com/grouppolicy/archive/2007/12/14/understanding-the-gpo-version-number.aspx">post</a>. The purpose of our script will be to notify us in quasi real time of modifications occuring on those files and folders.</p>
<p>What are the pros and cons of our method in comparison to the <a href="http://blogs.msdn.com/ericfitz/archive/2005/08/04/447951.aspx">eventlog monitoring</a> method?</p>
<ul>
<li><strong>Cons:</strong> You should expect a CPU load on the DC where you run the script. You need a <a href="http://blog.scottlowe.org/2007/07/20/delayed-replication-dcs-and-authoritative-restores/">lag site</a> if you want to retrieve accurate information when a GPO deletion occurs. You cannot get the username of the person who made the modification. You are notified of GPO modification when the SYSVOL replication occurs on the DC where you run the script.</li>
<li><strong>Pros:</strong> If you want to track in real time the security log of your DCs you need a Syslog software (like <a href="http://www.kiwisyslog.com/kb/how-to:-receive-windows-event-log-information/">Kiwi</a> or <a href="http://www.intersectalliance.com/projects/SnareWindows/">Snare</a>), but you need to pay for that. You need to activate auditing and install a Snare service on every DC, our script runs on just one DC. </li>
</ul>
<p>So, how do you create a service (script) that will monitor GPO changes on your domain? For this you will need  <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&#038;displaylang=en">WMI code creator</a>, this tool will help to create a script that tracks <em>{%GPO_GUID%}</em> folder creation/deletion and <em>{%GPO_GUID%}gpt.ini </em>file modification on the sysvol share.</p>
<p>We will use WMI <a href="http://technet.microsoft.com/en-us/library/ee692847.aspx">asynchronous event monitoring</a>. You just need to follow those steps to monitor the creation of <em>{%GPO_GUID%}:</em> folders.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/wmi1.jpg" rel=”lightbox” title="wmi code creator" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-282" title="wmi code creator" src="http://www.ldap389.info/wp-content/uploads/2010/03/wmi1-300x258.jpg" alt="" width="300" height="258" /></a></p>
<p>During step 5 you need to input the name of the root folder you are monitoring :<em>&#8216;Win32_Directory.Name=&#8221;"F:\WINDOWS\SYSVOL\domain\Policies&#8221;"&#8216;&#8221;</em>, that contains all the subfolders <em>{%GPO_GUID%} </em> created.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/wmi2.jpg" rel=”lightbox” title="wmi property" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-283" title="wmi property" src="http://www.ldap389.info/wp-content/uploads/2010/03/wmi2-300x168.jpg" alt="" width="300" height="168" /></a></p>
<p>And here we have our WMI asynchronous event query:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/wmi3.jpg" rel=”lightbox” "wmi code" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-284" title="wmi code" src="http://www.ldap389.info/wp-content/uploads/2010/03/wmi3-300x107.jpg" alt="" width="300" height="107" /></a></p>
<p>For more information about this method you can browse this <a href="http://msdn.microsoft.com/en-us/library/aa393865(VS.85).aspx">webpage</a>.<br />
Now we can monitor <em>{%GPO_GUID%} </em>folder creation/deletion, we just need to retrieve the GPO display name with an LDAP query by using this script:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">On</span> <span style="color: #000080;">error</span> <span style="color: #000080;">resume</span> <span style="color: #000080;">next</span>
strComputer = <span style="color: #800000;">&quot;.&quot;</span>
DomainDN = <span style="color: #800000;">&quot;DC=ldap389,DC=info&quot;</span>
DomainDNSFQDN = <span style="color: #800000;">&quot;ldap389.info&quot;</span>
LAGDC = <span style="color: #800000;">&quot;LAG_DC&quot;</span>
BackupLocationTool = <span style="color: #800000;">&quot;G:Tool&quot;</span>
<span style="color: #000080;">Const</span> ForAppending = 8
<span style="color: #000080;">Set</span> FSO = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
&nbsp;
<span style="color: #000080;">Set</span> objWMIService = GetObject(<span style="color: #800000;">&quot;winmgmts:&quot;</span> &amp; strComputer &amp; <span style="color: #800000;">&quot;rootCIMV2&quot;</span>)
<span style="color: #000080;">Set</span> MySink = WScript.CreateObject( _
    <span style="color: #800000;">&quot;WbemScripting.SWbemSink&quot;</span>,<span style="color: #800000;">&quot;SINK_&quot;</span>)
&nbsp;
<span style="color: #000080;">Set</span> MySink2 = WScript.CreateObject( _
    <span style="color: #800000;">&quot;WbemScripting.SWbemSink&quot;</span>,<span style="color: #800000;">&quot;SINK2_&quot;</span>)
&nbsp;
objWMIservice.ExecNotificationQueryAsync MySink, _
    <span style="color: #800000;">&quot;SELECT * FROM __InstanceCreationEvent WITHIN 60 WHERE &quot;</span> &amp; _
                    <span style="color: #800000;">&quot;TargetInstance ISA 'Win32_SubDirectory'&quot;</span> &amp; _
                    <span style="color: #800000;">&quot; AND TargetInstance.GroupComponent = 'Win32_Directory.Name=&quot;</span><span style="color: #800000;">&quot;F:\WINDOWS\SYSVOL\domain\Policies&quot;</span><span style="color: #800000;">&quot;'&quot;</span>
&nbsp;
objWMIservice.ExecNotificationQueryAsync MySink2, _
    <span style="color: #800000;">&quot;SELECT * FROM __InstanceDeletionEvent WITHIN 60 WHERE &quot;</span> &amp; _
                    <span style="color: #800000;">&quot;TargetInstance ISA 'Win32_SubDirectory'&quot;</span> &amp; _
                    <span style="color: #800000;">&quot; AND TargetInstance.GroupComponent = 'Win32_Directory.Name=&quot;</span><span style="color: #800000;">&quot;F:\WINDOWS\SYSVOL\domain\Policies&quot;</span><span style="color: #800000;">&quot;'
&nbsp;
While (True)
    Wscript.Sleep(1000)
Wend
&nbsp;
Sub SINK_OnObjectReady(objObject, objAsyncContext)
	gpofullpath = objObject.TargetInstance.Properties_.item(&quot;</span>PartComponent<span style="color: #800000;">&quot;).value
	gpoid1 = split(lcase(gpofullpath),&quot;</span>policies<span style="color: #800000;">&quot;)
	gpouid = replace(gpoid1(1),chr(34),&quot;</span><span style="color: #800000;">&quot;)
&nbsp;
	strGPODN = &quot;</span>CN=<span style="color: #800000;">&quot;&amp;gpouid&amp;&quot;</span>,CN=Policies,CN=System,<span style="color: #800000;">&quot;&amp;DomainDN
&nbsp;
		Set objGPO = GetObject(&quot;</span>LDAP://<span style="color: #800000;">&quot; &amp; strGPODN)
		StrGPOName = objGPO.DisplayName
&nbsp;
	Set df80 = FSO.OpenTextFile(BackupLocationTool&amp;&quot;</span>GPM-Modified.log<span style="color: #800000;">&quot;,ForAppending)
	df80.writeline(now&amp;&quot;</span>;CREATED;<span style="color: #800000;">&quot;&amp;gpouid&amp;&quot;</span>;<span style="color: #800000;">&quot;&amp;StrGPOName)
	df80.close
End Sub
&nbsp;
Sub SINK2_OnObjectReady(objObject, objAsyncContext)
    gpofullpath = objObject.TargetInstance.Properties_.item(&quot;</span>PartComponent<span style="color: #800000;">&quot;).value
StrGPOName = &quot;</span>N/A<span style="color: #800000;">&quot;
	gpoid1 = split(lcase(gpofullpath),&quot;</span>policies<span style="color: #800000;">&quot;)
	gpouid = replace(gpoid1(1),chr(34),&quot;</span><span style="color: #800000;">&quot;)
		if LAGDC &lt;&gt; &quot;</span><span style="color: #800000;">&quot; then
		strGPODN = &quot;</span>CN=<span style="color: #800000;">&quot;&amp;gpouid&amp;&quot;</span>,CN=Policies,CN=System,<span style="color: #800000;">&quot;&amp;DomainDN
		err.clear
		Set objGPO = GetObject(&quot;</span>LDAP://<span style="color: #800000;">&quot; &amp;LAGDC&amp;&quot;</span>/<span style="color: #800000;">&quot;&amp;strGPODN)
		if err.number &lt;&gt; 0 then
		StrGPOName = &quot;</span>N/A<span style="color: #800000;">&quot;
		else
		StrGPOName = objGPO.DisplayName
		End if
		End if
	Set df80 = FSO.OpenTextFile(BackupLocationTool&amp;&quot;</span>GPM-Modified.log<span style="color: #800000;">&quot;,ForAppending)
df80.writeline(now&amp;&quot;</span>;DELETED;<span style="color: #800000;">&quot;&amp;gpouid&amp;&quot;</span>;<span style="color: #800000;">&quot;&amp;StrGPOName)
df80.close
End Sub
&nbsp;
Sub SINK_OnCompleted(objObject, objAsyncContext)
End Sub</span></pre></div></div>

<p>Download vbs script here (recomanded):</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/GPM1.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>You will need to change the following values on the script:</p>
<ul>
<li>DomainDN = &#8220;DC=ldap389,DC=info&#8221;, Your domain <a href="http://msdn.microsoft.com/en-us/library/aa366101(VS.85).aspx"><em>Distinguished Name</em></a>.</li>
<li>DomainDNSFQDN = &#8220;ldap389.info&#8221;, fully qualified domain name</li>
<li>BackupLocationTool = &#8220;G:Tool&#8221;, Folder where the script runs.</li>
<li>LAGDC = &#8220;LAG_DC&#8221;, If you want to get GPO friendly name and not GUID when a deletion occurs you will need a<a href="http://blogs.technet.com/askds/archive/2008/10/20/lag-site-or-hot-site-aka-delayed-replication-for-active-directory-disaster-recovery-support.aspx"> Lag site</a>, the DC with delayed replication will help you to get deleted GPO <em>displayname</em>, because attribute might be already deleted on other DCs.If you do not have a lag site just input LAGDC = &#8220;&#8221;</li>
</ul>
<p>We now want to monitor modifications happening on <em>GPT.INI </em> files that are located on the SYSVOL share, we will use the following script:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">objWMIservice.ExecNotificationQueryAsync MySink3, _
    <span style="color: #800000;">&quot;SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE &quot;</span> &amp; _
                    <span style="color: #800000;">&quot;TargetInstance ISA 'CIM_DataFile'&quot;</span> &amp; _
                    <span style="color: #800000;">&quot; AND TargetInstance.Drive = 'F:'&quot;</span> &amp; _
                    <span style="color: #800000;">&quot; AND TargetInstance.Extension = 'ini'&quot;</span> &amp; _
                    <span style="color: #800000;">&quot; AND TargetInstance.FileName = 'gpt'&quot;</span>
&nbsp;
<span style="color: #000080;">Sub</span> SINK3_OnObjectReady(objObject, objAsyncContext)
&nbsp;
<span style="color: #000080;">if</span> objObject.TargetInstance.Properties_.item(<span style="color: #800000;">&quot;LastModified&quot;</span>).value &lt;&gt; objObject.PreviousInstance.Properties_.item(<span style="color: #800000;">&quot;LastModified&quot;</span>).value <span style="color: #000080;">then</span>
	gpofullpath = objObject.TargetInstance.Properties_.item(<span style="color: #800000;">&quot;Name&quot;</span>).value
&nbsp;
	<span style="color: #000080;">if</span> instr(gpofullpath,DomainDNSFQDN) = 0 <span style="color: #000080;">then</span>
&nbsp;
		gpoid1 = split(lcase(gpofullpath),<span style="color: #800000;">&quot;policies&quot;</span>)
&nbsp;
		gpoid2 = split(lcase(gpoid1(1)),<span style="color: #800000;">&quot;gpt.in&quot;</span>)
		gpouid = gpoid2(0)
&nbsp;
		strGPODN = <span style="color: #800000;">&quot;CN=&quot;</span>&amp;gpouid&amp;<span style="color: #800000;">&quot;,CN=Policies,CN=System,&quot;</span>&amp;DomainDN
		<span style="color: #000080;">Set</span> objGPO = GetObject(<span style="color: #800000;">&quot;LDAP://&quot;</span> &amp; strGPODN)
		StrGPOName = objGPO.DisplayName
&nbsp;
	<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">if</span>
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></pre></div></div>

<p>Download vbs script here (recomanded for syntax problem in plug-in):</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/07/GPM1.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>If you want to know more on how to monitor changes on the file system you can read this <a href="http://blogs.technet.com/heyscriptingguy/archive/2005/04/04/how-can-i-monitor-for-different-types-of-events-with-just-one-script.aspx">post</a>. Once you have adapted the script to your needs it will run on a SYSVOL that is not too big otherwise you might encounter performance problems.</p>
<p>If you have thousands of GPOs in your domain, your script has to monitor loads of folders and files and you might reach a <a href="http://blogs.technet.com/askperf/archive/2008/09/16/memory-and-handle-quotas-in-the-wmi-provider-service.aspx">WMI quota</a>. You will get this kind of error message: <em>wmi quota violation 0x8004106C </em> (check WMI error codes <a href="http://msdn.microsoft.com/en-us/library/aa394559(VS.85).aspx">here</a>). When monitoring 3500 GPOs our script crashed with this error after a few minutes. We used wbemtest.exe to change some values in the <a href="http://msdn.microsoft.com/en-us/library/aa393013%28VS.85%29.aspx#subscription_quotas">__ArbitratorConfiguration</a> super class. We used the following rule: %Total = %PerUser. This way the account running the service (script) will not be limited by a user quota, the quota limitation will just be the total. In that case you should expect an additional CPU/Memory load on your DC. Here is a CPU Graph (dual core 2,5Ghz) monitoring 3500 GPOs.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/cpu_dc.jpg" title="cpu dc" rel=”lightbox” rel="lightbox[343]"><img class="aligncenter size-medium wp-image-299" title="cpu dc" src="http://www.ldap389.info/wp-content/uploads/2010/03/cpu_dc-300x116.jpg" alt="" width="300" height="116" /></a></p>
<p>We will now need to create a Windows service from a script: Just read this <a href="http://www.visualbasicscript.com/m67553.aspx">tutorial</a> which is really well explained. We just followed the different steps explained in the post.</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/vbsservice.jpg" rel=”lightbox” title="vbs service" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-296" title="vbs service" src="http://www.ldap389.info/wp-content/uploads/2010/03/vbsservice-300x32.jpg" alt="" width="300" height="32" /></a></p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/vbs_service2.jpg" rel=”lightbox” title="vbs_service" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-297" title="vbs_service" src="http://www.ldap389.info/wp-content/uploads/2010/03/vbs_service2-300x107.jpg" alt="" width="300" height="107" /></a></p>
<p>You can also add a dependence on the WMI service. Your service will not start until WMI is ready:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/vbsservice3.jpg" rel=”lightbox” title="dependancy service" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-298" title="dependancy service" src="http://www.ldap389.info/wp-content/uploads/2010/03/vbsservice3-300x124.jpg" alt="" width="300" height="124" /></a></p>
<p>That&#8217;s it, your service can monitor SYSVOL changes. You can be aware of GPT changes occurring in your domain. Next post will show how to monitor Group Policy Links, for this we will use the GPLink attribute which is enabled in <a href="http://technet.microsoft.com/en-us/library/cc773209(WS.10).aspx">default audit settings</a>. Just see this tab:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2010/03/gplinktab.jpg" rel=”lightbox” title="gplink audit" rel="lightbox[343]"><img class="aligncenter size-medium wp-image-294" title="gplink audit" src="http://www.ldap389.info/wp-content/uploads/2010/03/gplinktab-300x195.jpg" alt="" width="300" height="195" /></a></p>
<p>Once you can monitor <a href="http://technet.microsoft.com/en-us/library/ee461061.aspx">GPLinks</a> changes on a <a href="http://www.netid.washington.edu/documentation/gpoOrder.aspx">OU/site/domain</a> you will be able, in combination with GPT modification information, to get all major changes on your GPOs:</p>
<ul>
<li>GPO creations</li>
<li>GPO deletions</li>
<li>User/Computer settings modifications </li>
<li>GPO Link modification</li>
</ul>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/hkRJl8lCrF8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/03/31/track-gpo-changes-monitor-gpt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/03/31/track-gpo-changes-monitor-gpt/</feedburner:origLink></item>
		<item>
		<title>Identify applications that cause your Domain Controller to decrease in performance</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/elVO5R8nhxs/</link>
		<comments>http://www.ldap389.info/en/2010/03/20/identify-applications-causes-dc-a-decrease-in-performance/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 17:20:10 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[tools @en]]></category>
		<category><![CDATA[troubleshooting @en]]></category>
		<category><![CDATA[cpu @en]]></category>
		<category><![CDATA[lsass @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=241</guid>
		<description><![CDATA[We will describe in this post how to indentify an application that causes a CPU time overconsumption on your Domain Controllers. We will use two tools for this: Server Performance Advisor and Wireshark. The first is used if you have a Windows 2003 DC, if OS is Windows 2008 the tool is already included, you [...]]]></description>
			<content:encoded><![CDATA[<p>We will describe in this post how to indentify an application that causes a CPU time overconsumption on your Domain Controllers. We will use two tools for this: <a href="http://www.microsoft.com/downloads/details.aspx?familyid=61a41d78-e4aa-47b9-901b-cf85da075a73&amp;displaylang=en">Server Performance Advisor</a> and <a href="http://www.wireshark.org/">Wireshark</a>. The first is used if you have a Windows 2003 DC, if OS is Windows 2008 the tool is already included, you access it with MMC snap-in <em>perfmon.msc</em>, its new name is <a href="http://technet.microsoft.com/en-us/library/cc755081(WS.10).aspx">Windows Reliability and Performance Monitor</a>. Both versions have performance counters dedicated to Active Directory, in this post we will use SPA, because the DC having trouble is running Windows 2003. If you want more details on using Windows RPM for AD you can read <a href="http://www.activedir.org/Articles/tabid/54/articleType/ArticleView/articleId/49/Default.aspx">this article</a>.<br />
<span id="more-241"></span><br />
When analysing the CPU graph below we can see that there is something unusual occuring on this DC. Process lsass is consuming a lot of CPU time:</p>
<p><a title="graphlsass1" rel="lightbox" href="http://www.ldap389.info/wp-content/uploads/2010/03/graphcpu1.jpg"><img class="aligncenter size-medium wp-image-231" title="graphcpu1" src="http://www.ldap389.info/wp-content/uploads/2010/03/graphcpu1-300x126.jpg" alt="" width="300" height="126" /></a></p>
<p>We can see that CPU is really busy during office hours, an application used by client computers might be a good lead for explaining this phenomenon. So we proceed with an anlysis of the DC with SPA and here are the results:</p>
<p><a title="server performance advisor" rel="lightbox" href="http://www.ldap389.info/wp-content/uploads/2010/03/spa.jpg"><img class="aligncenter size-medium wp-image-233" title="spa" src="http://www.ldap389.info/wp-content/uploads/2010/03/spa-300x147.jpg" alt="" width="300" height="147" /></a></p>
<p>There is a <em>SamEnumUsersInDomain </em>request that consumes 42% of CPU load. Unfortunatly we cannot identify clearly the clients with SPA, so we will use <a href="http://www.wireshark.org/">WireShark</a> to monitor DC&#8217;s network activity.</p>
<p><a title="wireshark" rel="lightbox" href="http://www.ldap389.info/wp-content/uploads/2010/03/wireshark.jpg"><img class="aligncenter size-medium wp-image-234" title="wiresharkanalysis" src="http://www.ldap389.info/wp-content/uploads/2010/03/wireshark-300x139.jpg" alt="" width="300" height="139" /></a></p>
<p>After analysing the data we can deduce that communication protocol used by client&#8217;s request is <a href="http://msdn.microsoft.com/en-us/library/cc245476(PROT.10).aspx">MS-SAMR</a>. So we just need to use the appropriate filter (SAMR) with Wireshark to identify the clients. We sent the computers list to the local IT support of the site impacted and it revealed that those clients were laptops with <a href="http://h20219.www2.hp.com/Hpsub/cache/292230-0-0-225-121.html">HP ProtectTools security manager</a> installed. This application was uninstalled on most of them because we do not use SMART cards and we could see the results on CPU Load almost immedialty:</p>
<p><a title="graphlsass.exe" rel="lightbox" href="http://www.ldap389.info/wp-content/uploads/2010/03/graphcpu2.jpg"><img class="aligncenter size-medium wp-image-235" title="graphcpu2" src="http://www.ldap389.info/wp-content/uploads/2010/03/graphcpu2-300x115.jpg" alt="" width="300" height="115" /></a></p>
<p>If you want to identify the application causing trouble on client&#8217;s side by filtering which process uses a particular protocol or sends a request to a particular machine you use can <a href="http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx">TCPview</a> or <a href="http://www.nirsoft.net/utils/cports.html">CurrPorts</a>, if you want more information on the second application you can read an article of my colleague on <a href="http://ctxblog.fr/index.php?post/2010/03/13/CurrPorts">CTXBlog</a> (it&#8217;s in french).</p>
<p>The issue concerning the HProtectTools application was discussed on <a href="http://forums13.itrc.hp.com/service/forums/bizsupport/questionanswer.do?admit=109447627+1269103616093+28353475&amp;threadId=1326693">this forum</a>. You need to upgrade to Sp41408 to get rid of the problem if you decide to keep the application on your laptops.</p>
<img src="http://feeds.feedburner.com/~r/Ldap389/~4/elVO5R8nhxs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2010/03/20/identify-applications-causes-dc-a-decrease-in-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2010/03/20/identify-applications-causes-dc-a-decrease-in-performance/</feedburner:origLink></item>
	</channel>
</rss>
