Microsoft Server Best Practices Analyzer Scan Results

First off as an Englishman I hate the use of ‘z’ in this way… It should be analyser but Microsoft being a US company I suppose I can’t really complain.

I recently reviewed the ‘Best Practices Analyzer’ (BPA) results on one of our servers and decided that a number of the results could be safely ignored. I chose to exclude these results from BPA and they vanished from the list as one would expect.

It then dawned on me that I wasn’t entirely certain how to get those results to show again. It would obviously be a case of enabling or altering a filter but how and where?

Conveniently Microsoft have a KB article that covers this in depth – Run Best Practices Analyzer Scans and Manage Scan Results

The article covers the use of both PowerShell and the GUI to interact and manage BPA results.

As I would like to use this website as my own reference I’m going to include a copy of the sections I’m interested in from the MS site.

 

Exclude and include BPA results

If you do not need to see some BPA results, such as results that occur frequently in your BPA scans but require no resolution, you can exclude the results, by using either the BPA GUI or BPA cmdlets in Windows PowerShell. Results can be included again at any time.

Note
When you exclude results, they are also excluded from view on managed servers. Other administrators cannot see excluded results on managed servers. To exclude results from view in a local Server Manager console only, create a custom query instead of using the Exclude Result command.

Exclude scan results

The Exclude setting is persistent; results that you exclude remain excluded in future scans of the same model on the same computer, unless they are included again.

You can exclude scan results by using the Set-BPAResult cmdlet with the Exclude parameter. As in the Best Practices Analyzer tile in Server Manager, you can exclude individual result objects, or you can also exclude a set of results whose fields (category, title, and severity, for example) are equal to or contain specified values. For example, you can exclude all Performance results from a set of scan results for a model.

Note
You must run at least one BPA scan on a model before you can use procedures in this section.

 

To exclude scan results by using the GUI

Open a role or server group page in Server Manager.

  • In the Best Practices Analyzer tile for the role or server group, right-click a result in the list, and then click Exclude Result.
  • The result is no longer displayed in the list of results.
    To view excluded results in the GUI, run the built-in Excluded results query. Click Saved Search Queries, and then click Excluded results.

 

After running the Excluded results query, note that the tile subheading text, a description of the results that are displayed in the list, changes to Excluded results. Only excluded results are displayed in the list.

 

To exclude scan results by using Windows PowerShell cmdlets

  • Open a Windows PowerShell session with elevated user rights.
  • Exclude specific results from a model scan by running the following command.
Get-BPAResult -ModelId <Model ID> | Where { $_.<Field Name> -eq "Value"} | Set-BPAResult -Exclude $true

The preceding command retrieves BPA scan result items for the model ID that is represented by Model ID.

The second section of the command filters the results of the Get-BPAResult cmdlet to retrieve only those scan results for which the value for a result field, represented by Field Name, matches the text in quotation marks.

The final section of the command, following the second pipe character, excludes the results that are filtered by the previous section of the cmdlet.

Example:

Get-BPAResult -Microsoft/Windows/FileServices | Where { $_.Severity -eq "Information"} | Set-BPAResult -Exclude $true

Include scan results

When you want to view scan results that were excluded, you can include those scan results. The Include setting is persistent; included results remain included in future scans of the same model on the same computer.

To include scan results by using the GUI

  • Open a role or server group page in Server Manager.
  • In the Best Practices Analyzer tile for the role or server group, right-click an excluded result in the Excluded results query list, and then click Include Result.

 

The result is no longer displayed in the list of excluded results. Clear the query by clicking Clear All to view the included result in the list of all included results.

To include scan results by using Windows PowerShell cmdlets

  • Open a Windows PowerShell session with elevated user rights.
  • Include specific results from a model scan by typing the following command, and then pressing Enter.
Get-BPAResult -ModelId <Model Id> | Where { $_.<Field Name> -eq "Value" } | Set-BPAResult -Exclude $false

The preceding command retrieves BPA scan result items for the model represented by Model Id.

The second part of the command, after the first pipe character ( | ) filters the results of the Get-BPAResult cmdlet to retrieve only those scan results for which the value of the result field, represented by Field Name, matches the text in quotation marks.

The final part of the command, after the second pipe character, includes results that are filtered by the second part of the cmdlet, by setting the value of the -Exclude parameter to false.

Example:

Get-BPAResult -Microsoft/Windows/FileServices | Where { $_.Severity -eq “Information”} | Set-BPAResult -Exclude $false

Again, as stated above I want to use this site as a complete reference for myself therefore I have copied and pasted all relevant sections from the MS KB article to save me jumping between links when I need to use this in future.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.