<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://pdconsec.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Deliberations from Dave : Windows 2003, Clustering</title><link>http://pdconsec.net/blogs/davidr/archive/tags/Windows+2003/Clustering/default.aspx</link><description>Tags: Windows 2003, Clustering</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Clustering with Access-Based Enumeration (Part 2)</title><link>http://pdconsec.net/blogs/davidr/archive/2007/05/31/clustering-with-access-based-enumeration-part-2.aspx</link><pubDate>Thu, 31 May 2007 11:24:00 GMT</pubDate><guid isPermaLink="false">7018334c-f1eb-43cd-8b71-71ccd06afea8:27</guid><dc:creator>davidr</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pdconsec.net/blogs/davidr/rsscomments.aspx?PostID=27</wfw:commentRss><comments>http://pdconsec.net/blogs/davidr/archive/2007/05/31/clustering-with-access-based-enumeration-part-2.aspx#comments</comments><description>&lt;p&gt;In &lt;a title="Clustering with Access-based Enumeration (Part 1)" href="http://pdconsec.net/blogs/davidr/archive/2007/05/30/clustering-with-access-based-enumeration-part-1.aspx" target="_blank"&gt;Part 1 of this article&lt;/a&gt; we wrote a short script to re-enable Access-Based Enumeration on a clustered file share. In part 2, we&amp;#39;ll dissect the script and make some improvements to the code so that the status of ABE can be checked. This will allow the Cluster Administrator console to show the true current state of Access-Based Enumeration to administrative users.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the original script:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;Function Online( )&lt;br /&gt;  on error resume next&lt;br /&gt;  &amp;#39; Call the ABECMD.EXE /Enable command for each share&lt;br /&gt;  Set oShell = CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;br /&gt;  oShell.Run &amp;quot;H:\ABECMD.EXE /enable ABEShare&amp;quot;, 1, true&lt;br /&gt;  if (Err.Number &amp;lt;&amp;gt; 0) then&lt;br /&gt;    Online = 1&lt;br /&gt;  end if&lt;br /&gt;  Online = 0&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function LooksAlive( )&lt;br /&gt;  LooksAlive = True&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function IsAlive( )&lt;br /&gt;  IsAlive = True&lt;br /&gt;End Function&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;The script is divided into 3 separate functions.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Online() Function&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The Online() function is called when the cluster resource monitor attempts to bring the Generic Script resource online. This function is responsible for taking any action that enables the required functionality for the script. In our case, we want to use the ABE command line utility ABECMD.EXE to enable ABE on the clustered share. It&amp;#39;s important to note the return values from the Online() function; if it returns zero (0) the function was successful and the resource is placed online. Other values will cause repeated attempts to bring the resource online, possibly followed by a failover.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The LooksAlive() Function&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The LooksAlive() function is called at intervals determined by the cluster resource configuration. &lt;a title="Scripting Entry Points" href="http://msdn2.microsoft.com/en-us/library/aa372846.aspx" target="_blank"&gt;Microsoft says the following&lt;/a&gt; about the LooksAlive() function:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Perform one or more very fast, cursory checks of the specified instance with the emphasis on detecting potential problems rather than verifying operational status. &lt;b&gt;IsAlive&lt;/b&gt; will determine whether the instance is really operational. Take no more than 300 milliseconds to return a value. Resource Monitor calls &lt;b&gt;LooksAlive&lt;/b&gt; repeatedly at a specified time interval (for example, once every five seconds).&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The default time interval for LooksAlive calls is 5 seconds but it is configurable by the administrator.&lt;/p&gt;
&lt;p&gt;We return True in this function to tell the Resource Monitor that ABE is probably active.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The IsAlive() Function&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The IsAlive() function is called at intervals determined by the cluster resource configuration. &lt;a title="Scripting Entry Points" href="http://msdn2.microsoft.com/en-us/library/aa372846.aspx" target="_blank"&gt;Microsoft says the following&lt;/a&gt; about the IsAlive() function:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Perform a complete check of the resource to see if it is functioning properly. The set of procedures you need to use depends on your resource. For example, a database resource should check to see that the database can write to the disk and perform queries and updates to the disk. If the resource has definitely failed, return FALSE. The Resource Monitor immediately sets the status of the resource to &amp;quot;ClusterResourceFailed&amp;quot; and calls the &lt;b&gt;Terminate&lt;/b&gt; entry point function. Resource Monitor calls &lt;b&gt;IsAlive&lt;/b&gt; repeatedly at a specified time interval (for example, once every sixty seconds).&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The default time interval for IsAlive calls is 60 seconds but it is configurable by the Administrator.&lt;/p&gt;
&lt;p&gt;We return True in this function to tell the Resource Monitor that ABE is definitely active.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Improving the IsAlive() function&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In part 1 we noted that we&amp;#39;re not really telling the truth about the ABE resource. We&amp;#39;re telling Resource Monitor that ABE is enabled, but we&amp;#39;re not checking it. So we change the IsAlive() function as follows:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;Function IsAlive( )&lt;br /&gt;  Set oShell = CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;br /&gt;  set wshRun = oShell.Exec (&amp;quot;H:\ABECMD.EXE ABEShare&amp;quot;)&lt;br /&gt;  if (Err.Number &amp;lt;&amp;gt; 0) or (wshRun.Status &amp;lt;&amp;gt; 0) then&lt;br /&gt;    IsAlive = False&lt;/code&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;  &lt;/code&gt;&lt;code&gt;  Exit Function&lt;br /&gt;&lt;/code&gt;&lt;code&gt;  &lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;else&lt;br /&gt;&lt;/code&gt;&lt;code&gt;    sABEOutput = wshRun.StdOut.ReadAll()&lt;br /&gt;    if InStr(sABEOutput, &amp;quot;enabled&amp;quot;) then&lt;br /&gt;      &lt;/code&gt;&lt;code&gt;IsAlive =&lt;/code&gt;&lt;code&gt; True&lt;br /&gt;&lt;/code&gt;&lt;code&gt;  &lt;/code&gt;&lt;code&gt;    Exit Function&lt;/code&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;  &lt;/code&gt;&lt;code&gt;  &lt;/code&gt;&lt;code&gt;end if&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;    &lt;/code&gt;&lt;code&gt;IsAlive = &lt;/code&gt;&lt;code&gt;False&lt;br /&gt;&lt;/code&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt; end if&lt;br /&gt;End Function&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;Now we&amp;#39;re really checking that ABE is enabled for the share. If an administrator comes along and disables ABE, the cluster Resource Monitor will know about it and we can take corrective action.&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description><category domain="http://pdconsec.net/blogs/davidr/archive/tags/Clustering/default.aspx">Clustering</category><category domain="http://pdconsec.net/blogs/davidr/archive/tags/Windows+2003/default.aspx">Windows 2003</category></item><item><title>Clustering with Access-Based Enumeration (Part 1)</title><link>http://pdconsec.net/blogs/davidr/archive/2007/05/30/clustering-with-access-based-enumeration-part-1.aspx</link><pubDate>Wed, 30 May 2007 05:24:00 GMT</pubDate><guid isPermaLink="false">7018334c-f1eb-43cd-8b71-71ccd06afea8:26</guid><dc:creator>davidr</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pdconsec.net/blogs/davidr/rsscomments.aspx?PostID=26</wfw:commentRss><comments>http://pdconsec.net/blogs/davidr/archive/2007/05/30/clustering-with-access-based-enumeration-part-1.aspx#comments</comments><description>&lt;p&gt;Access-Based Enumeration is a rather cool add-on to Windows Server 2003 that allows an administrator to restrict what users can see on a file share. If Access-Based Enumeration is enabled for a share, a user can see only the files and folders to which they have access. This can help reduce support calls from users, eg &amp;quot;Why do I get this Access Denied error on the Finance folder?&amp;quot; and make it simpler for users to access the data they need.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;For example, here&amp;#39;s the view of an ABE-enabled share for an &lt;a title="Administrator view of an ABE-Enabled Share" href="http://pdconsec.net/blogs/davidr/AdminView.png" target="_blank"&gt;Administrator&lt;/a&gt;. A finance user on the other hand will see a &lt;a title="Finance User view of an ABE-Enabled Share" href="http://pdconsec.net/blogs/davidr/FinanceView.png" target="_blank"&gt;different view&lt;/a&gt;, and a normal user will see an &lt;a title="User view of an ABE-Enabled Share" href="http://pdconsec.net/blogs/davidr/UserView.png" target="_blank"&gt;even more restricted view&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now that all works fine on a single server without any further effort on the administrator&amp;#39;s part.&lt;/p&gt;
&lt;p&gt;When you enable ABE on a clustered file share, it will all appear to work just fine until the file share is failed over to another node. When this happens the file share will no longer be ABE-enabled, and the share will revert to the standard Windows 2003 behaviour. To get around this, we write a VBScript application and register it as a cluster resource within the appropriate cluster group.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a script that does exactly this - note that it assumes ABECMD.EXE is available on the cluster drive (in this case, H:\) and that the share is called ABEShare:&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;Function Online( )&lt;br /&gt;  on error resume next&lt;br /&gt;  &amp;#39; Call the ABECMD.EXE /Enable command for each share&lt;br /&gt;  Set oShell = CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;br /&gt;  oShell.Run &amp;quot;H:\ABECMD.EXE /enable ABEShare&amp;quot;, 1, true&lt;br /&gt;  if (Err.Number &amp;lt;&amp;gt; 0) then&lt;br /&gt;    Online = 1&lt;br /&gt;  end if&lt;br /&gt;  Online = 0&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function LooksAlive( )&lt;br /&gt;  LooksAlive = True&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function IsAlive( )&lt;br /&gt;  IsAlive = True&lt;br /&gt;End Function&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;The version 1 script above is sufficient to re-establish Access-Based Enumeration on a clustered file share after failover. &lt;a title="Scripting Entry Points" href="http://msdn2.microsoft.com/en-us/library/aa372846.aspx"&gt;Microsoft recommends&lt;/a&gt; not placing the script files on the cluster disk, but for this type of script I think placing it on the cluster disk is acceptable. You may choose to store the script in the same location on each cluster node; but I&amp;#39;m not entirely convinced that the stated benefits outweigh the disadvantages in managing the script (replication etc). YMMV.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Implementing is simple. Add a new resource to the cluster group of type Generic Script. Your Possible Owners for the new resource should include all nodes on which the ABE share must be available. Set the script to be dependent on the File Share resource, and set the Script filepath to be the full path (H:\ABEShare.VBS) to the VBS file. When you being the resource online, the share will become ABE-enabled.&lt;/p&gt;
&lt;p&gt;The script above has some limitations, the most glaring of which is that if an Administrator disables ABE (either using the command-line tools, or the Windows Explorer interface) the cluster will not know about it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In part 2 I&amp;#39;ll expand on the VBScript above and describe some improvements that allow the script to report the true status back to the cluster Resource Monitor.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description><category domain="http://pdconsec.net/blogs/davidr/archive/tags/Clustering/default.aspx">Clustering</category><category domain="http://pdconsec.net/blogs/davidr/archive/tags/Windows+2003/default.aspx">Windows 2003</category></item></channel></rss>