Bill Baer

Senior Product Marketing Manager (SharePoint), Microsoft Certified Master for SharePoint, Microsoft Corporation

Understanding the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System Rule File

Understanding the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System Rule File

  • Comments 10
  • Likes

Since my original post Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System Available! , I've received several comments and requests for information on how to create custom rule definitions that can be used with the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System. The article below references the basic steps required to create and use custom rule definitions.

The default rule definitions for the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System are contained within sharepointbpa.config.xml.  sharepointbpa.config.xml is available in the directory specified during the installation.

<Object Type="Registry" Key1="%SERVER_NAME%" Key3="SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB\">
  <Setting Key1="dsn" Substitution="CONFIG_DB_CONN" />

The Object element defines the object to be parsed using the Type element. In the example above, the configuration database connection string is gathered from the Registry key SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB\dsn as CONFIG_DB_CONN. The connection string is stored in the dsn key as Data Source=<DatabaseServer>;Initial Catalog=<ConfigurationDatabase>;Integrated Security=True;Enlist=False. CONFIG_DB_CONN is used for variable substitution when executing T-SQL statements against the configuration database. Variable substitution defines the server name through the command line switch -substitution SERVER_NAME. 

In the Incoming E-Mail test (below), the connection string is passed to the statement as %CONFIG_DB_CONN% and the subsequent statement executed as select count(*) AS WSS_INCOMING_EMAIL from dbo.objects where classid = 'b0bde0e6-6fb0-4f14-a93f-93170dc5b3ed'. This statement returns a numeric value of TRUE = 1 or FALSE = 0. If the result of the statement is less than 1 using the Query attribute value of <1, the Rule object is instantiated and reported using the Error, Title, and Text attributes. Following these basic rules you can establish custom rules in the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System rule file.

<Object Type="SQL" Key1="%CONFIG_DB_CONN%" Key2="select count(*) AS WSS_INCOMING_EMAIL from dbo.objects where classid = 'b0bde0e6-6fb0-4f14-a93f-93170dc5b3ed'" Display="Hide">
  <Setting Key1="WSS_INCOMING_EMAIL">
    <Rule Name="szWSSIncomingEMail" Query="$.&lt;1" Error="Warning" Sev="1" Title="Incoming e-mail settings are not configured" Text="You should configure the incoming e-mail settings to allow the document libraries and lists on your SharePoint sites to receive and archive incoming e-mail. SharePoint sites can archive e-mail discussions as they happen, save e-mailed documents, and show e-mailed meetings on site calendars. Configure the SharePoint Directory Management Service to provide support for e-mail distribution group creation and management. You must also install the Windows Server SMTP service on the SharePoint server that receives and processes incoming e-mail. To enable incoming e-mail for this server, from SharePoint 3.0 Central Administration, open the Operations pages, and then in the Topology and Services area click Incoming e-mail settings. On the Configure Incoming E-Mail Settings page, configure the settings for your incoming e-mail." P1="$." />
  </Setting>
</Object>

The example below is a custom rule definition that verifies the installation of the SQL Server 2005 Reporting Services Web Part Package.

<Object Type="SQL" Key1="%CONFIG_DB_CONN%" Key2="select count(*) AS INSTALLED_WP_PACKAGES from webpartpackages where title = 'rswebparts.cab'" Display="Hide">
  <Setting Key1="INSTALLED_WP_PACKAGES"><Rule Name="szInstalledWPPackages" Query="$.&lt;1" Error="Warning" Sev="1" Title="The SQL Server 2005 Reporting Services Web Parts are not installed." Text="You should confirm the Web Part package is installed to every web front-end computer in the server farm or reinstall the package using the -globalinstall parameter." P1="$." />
  </Setting>
</Object>

In the above example, I elected to obtain a count of Web Part packages whose title is equal to rswebparts.cab, if the result was less than 1, the rule is instantiated and my custom error definition rendered in the output report file.

Rule definitions can also include Registry checks for specific key values and/or name sets. The example below was taken from the default rule file packaged with the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System.

<Object Type="Registry" Key1="%SERVER_NAME%" Key3="SYSTEM\CurrentControlSet\Services\WSSArpi\Performance">
  <Setting Key1="Disable Performance Counters">
    <Rule Name="szWSSArpiPerfmon" Title="WSSArpi Performance Counters Disabled" Error="Error" Query="matches($.,'1')" Text="When the WSSArpi performance counters are disabled some SharePoint Products and Technologies performance counters are not available in Performance Monitor. To enable these counters, use a registry editor to remove the Disable Performance Counters key from HKLM\SYSTEM\CurrentControlSet\Services\WSSArpi\Performance." Sev="1" />
  </Setting>
</Object>

The Object Type attribute defines the object to be parsed, in this case the Registry. The Key1 attribute is a substitution value that specifies the server name (see above). The attribtute, Key3, defines the path to be checked in the definition. In this example the path SYSTEM\CurrentControlSet\Services\WSSArpi\Performance is parsed and the Query attribute matches($.,'1') applied to determine the existence of the key value Disable Performance Counters. If the value is present the rule is instantiated and written to the output report file.

<Object Type="Registry" Key1="%SERVER_NAME%" Key3="SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS">
  <Setting Key1="SetupType">
    <Rule Name="szInstallationType" Title="Installation Type Reported" Error="Warning" Query="matches($.,'CLEAN_INSTALL')" Text="The installation type reported by this server has been determined to be a clean installation of Windows SharePoint Services 3.0. This is informational text only!" Sev="1" />
  </Setting>
</Object>

In the above example, I elected to return the Windows SharePoint Services installation type from the Registry. Using the path SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\SetupType in the Key3 and Key1 attributes the Query attribute matches($.,'CLEAN_INSTALL') is applied and returns TRUE a value matching the text CLEAN_INSTALL, optionally this can be configured to return a result where the text does not match CLEAN_INSTALL. This is a fairly basic example of using rule definitions, but illustrates the rules definition capabilities that can be applied in the rule definition file.

The Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System can also be used to run checks against XML objects as shown in the example below taken from the default rule file packed with the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System.

<Object Type="XML" Key1="%EXCEL_XML_BLOB%" Key3="//field[@name='m_memoryCacheThreshold']/text()" Key4="STRING"> 
  <Setting Key1="."> 
  <!-- 30 > $. and $. > 0 -->
    <Rule Name="szExcelm_memoryCacheThreshold1" Query="30 > $. and $. > 0" Error="Warning" Sev="2" Title="Memory Cache Threshold is too Small" Text="Memory cache threshold is set at {1}%. This threshold, together with the Maximum Private Bytes, determines the amount of caching that Excel Calculation Service within SSP {2} is able to provide. If you set the threshold lower than 30% cache performance is limited. We recommend that you configure this threshold to be greater than 30%." P1="$." S2="%SSP_DB_INSTANCE_NAME%" />
    <!-- $. = 0 -->
    <Rule Name="szExcelm_memoryCacheThreshold2" Query="$. = 0" Error="Warning" Sev="2" Title="Memory Caching of Unused Objects is Disabled" Text="Memory caching of unused objects is disabled. This may affect Excel Calculation Service performance within SSP {2} and will affect the response time experienced by users." S2="%SSP_DB_INSTANCE_NAME%" />
  </Setting>
</Object>

Among other object types that can be checked using the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System are FILE, GROUP and METABASE types, the examples below were taken from the default rule file packaged with the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System - I'm still experimenting with WMI so stay tuned!

      <Object Type="Metabase" Key1="%SERVER_NAME%" Key2="/LM/W3SVC/AppPools/SharePoint Central Administration v3" Display="Hide">
        <Setting Key1="7501" Substitution="WSS_APP_POOL_ACCOUNT" Format="LowerCase" />
        <Object Type="Registry" Key1="%SERVER_NAME%" Key3="SYSTEM\ControlSet001\Services\SPTimerV3" Display="Hide">
          <Setting Key1="ObjectName" Format="LowerCase"/>
          <Rule Name="szAcctMismatch2" Query="$. != '%WSS_APP_POOL_ACCOUNT%'" Error="Error" Sev="1" Title="The SharePoint 3.0 Central Administration Web application account and the Windows SharePoint Services Timer Service account must be the same" Text="The same account that you use to run SharePoint 3.0 Central Administration must be configured as the SharePoint Timer Service. If they are not the same, the system may not be able to send Alert Notifications and you will not be able to add a content database to a web application using the Manage Content Databases page. Although there are built in mechanisms to keep these accounts synchronized, it is possible to manually change the SharePoint Timer Service account. If the account that you are using to run SharePoint 3.0 Central Administration is the correct account, you can log on to the Web server where the SharePoint Timer Service running as the wrong account. From a command prompt change to the directory where the SharePoint Timer Service is running, this is typically C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN, and run the command: stsadm -o updatefarmcredentials -identitytype configurableid -userlogin domain\account -password password. Although you could directly update the SharePoint Time Server account by opening Administrative Tools, Component Services, you should use this approach only as a last resort. To avoid inconsistencies between the configuration database settings and what the accounts for the services, changes to SharePoint service accounts must be completed through SharePoint 3.0 Central Administration." />
        </Object>
      </Object>
      <Object Type="File" Key1="%SERVER_NAME%" Key2="C:\boot.ini" Display="Hide">
        <!--Getting Default parameter from boot.ini -->
        <Setting Key1="Ini" Key2="Boot Loader" Key3="Default" Substitution="BootINIImage" Format="^default=.*----$1" />
        <Object Type="File" Key1="%SERVER_NAME%" Key2="C:\boot.ini">
          <!--Using the Default boot image selection from the Setting above, check it for /3gig-->
          <Setting Key1="Ini" Key2="operating systems" Key3="%BootINIImage%">
            <!--Extract the Default OS from the c:\Boot.ini file-->
            <Rule Name="szBootIniOSSwitches" Query="matches($.,'^.*/3gig*')" Error="Error" Sev="1" Title="Default Boot Image contains unsupported /3gig switch" Text="SharePoint Products and Technologies use an Internet Information Server (IIS) data transfer size that is larger than the operating system can handle in the 32-bit 3 gigabyte (GB) mode, which is invoked by the /3gig switch. Although SharePoint Products and Technologies is configured to attempt to transfer documents to clients in one megabyte packets, when you use the /3gig switch, the operating system kernel mode is optimized to run in one gigabyte or less and if the server has a performance bottleneck, the size of each chunk may be too large for IIS to transfer. To reduce the IIS data transfer size setting would severely affect overall performance including file uploads. We recommend that you remove the /3gig switch from the boot.ini file and restart your server." />
          </Setting>
        </Object>
      </Object>
    </Object>
Comments
  • Hi William,

    Can you please help me out and tell me which exactly the best practice rules are?

    Thanks!

  • The rules included in the packaged configuraton file define the basic best practices in a Microsoft Office SharePoint Server 2007/Windows SharePoint Services 3.0 installaton.  Additional rules can be applied using the instructions above to tune the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System specific to your deployment.

  • “Microsoft Best Practices Analyzer for Microsoft® Windows® SharePoint® Services 3.0 and the 2007 Microsoft®

  • Hi William   Thank you for providing the Best Practises Guidance for setting rules.  I have attempted to use the Best Practices Analyzer to resolve setup issues we're experiencing.  Unfortunately We have not discovered a resolution by using the Best Practices Analyzer.   We're able to obtain a report from the Best Practices Analyzer.  We had hopefuly thought the Best Practices Analyzer  would detect any outstanding issues.  However, when we have used the generic Best Practices Analyzer the program fails to connect to the SQL database.  

    This is the workflow observed :

    Beginning analysis using the following options:

    Rules file: e:\folder\sharepointbpa.config.xml

    report format: html

    report output: something.html

    Starting Collections Data phase

    'Error connection to SQl Server' An error has occurred while establishing a connection to the server.  When connecting  etc etc... does not allow remote connections <provider: SQL Netwrok Interfaces, error 26 - Error location server/instance specified

    Completed Collecting data phase,

    Starting Postprocessing rules phase,

    Completed Postprocessing rules phase,

    The analysis is complete.  A report can be viewed etc etc...

    The report does not have any reference to the SQL connection  failure or its condition.

    Did the Best Practices Analyzer actually complete?  How do we determine this error condition of a bad sql connection using the  Best Practices Analyzer?

  • The default rules available the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System provide base verification rules to support a broad and varying range of SharePoint Products and Technologies deployments.  The error indicates a possilbe connectivity issue between the machine on which the Microsoft Best Practices Analyzer for Windows SharePoint Services 3.0 and the 2007 Microsoft Office System was run and the SQL database server.  I would recommend first confirming connectivity from this machine to the SQL database server and additonally ensuring remote connections are enabled on the instance of SQL server you wish to connect to from the remote machine.

  • Hi, Today I wanted to share howto use the "Microsoft Best Practices Analyzer for Windows SharePoint Services

  • Hi, Today I wanted to share howto use the &quot;Microsoft Best Practices Analyzer for Windows SharePoint

  • SharePoint best practices analyzer (available for download from here ) is an interesting tool that provides

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment