Listing and Running Best Practice Analyzers from Command Prompt
Microsoft has developed system management tools called Best Practice Analyzers for several server roles and features, sometimes referred as BPA. These tools contain the best practices defined for several server roles and features. You can use these tools to scan the entire system and then generate a report on the system’s compliance level.
There are three PowerShell cmdlets you can use to work with the Best Practice Analyzer tools; Get-BPAModel and Invoke-BPAModel and Get-BPAResult.
To list all the available Best Practice Analyzers on the system running Windows Server 2012, you can run a PowerShell cmdlet as shown below:
- Get-BPAModel | Format-Table ID,Name,LastScanTime –AutoSize
To run a BPA:
- Invoke-BpaModel -ModelId Microsoft/Windows/FileServices
To get the result of the BPA:
- Get-BpaResult -ModelId Microsoft/Windows/FileServices | Where-Object Severity -NE Information
Note: Get-BPAModel lists the ID of all the BPAs. Once you know the ID, you can use that ID with Invoke-BPAModel and Get-BPAResult PowerShell cmdlets. “Microsoft/Windows/FileServices” is the ID for File Services BPA.
About Nirmal Sharma
Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services. He is specialized in Directory Services, Microsoft Clustering, Hyper-V, SQL and Exchange and has been involved in Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles. Nirmal can be reached at [email protected].