{"id":4505,"date":"2012-12-06T00:01:00","date_gmt":"2012-12-06T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2012\/12\/06\/use-the-powershell-best-practices-module-to-configure-servers\/"},"modified":"2012-12-06T00:01:00","modified_gmt":"2012-12-06T00:01:00","slug":"use-the-powershell-best-practices-module-to-configure-servers","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-the-powershell-best-practices-module-to-configure-servers\/","title":{"rendered":"Use the PowerShell Best Practices Module to Configure Servers"},"content":{"rendered":"<p><strong>Summary:<\/strong> Microsoft Scripting Guy, Ed Wilson, talks about using the Windows PowerShell Best Practices module to audit configuration of servers.<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Well, tonight is the Charlotte Windows PowerShell user group. We are doing a mini version of the Scripting Games, and so if you are in the area, you should check it out. It is a great learning experience to see how four or five different people approach the same problem.<\/p>\n<h2>Exploring the Best Practices module<\/h2>\n<p>Today, I decided to play around with the Best Practices module on my domain controller running Windows Server&nbsp;2012. To find the available cmdlets, I used the <strong>Get-Command<\/strong> cmdlet to look at the Best Practices module, as shown here.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-Command -Module bestpractices<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">CommandType&nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ModuleName<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;-<\/p>\n<p style=\"padding-left: 30px\">Cmdlet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get-BpaModel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BestPractices<\/p>\n<p style=\"padding-left: 30px\">Cmdlet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get-BpaResult&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BestPractices<\/p>\n<p style=\"padding-left: 30px\">Cmdlet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Invoke-BpaModel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BestPractices<\/p>\n<p style=\"padding-left: 30px\">Cmdlet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set-BpaResult&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BestPractices<\/p>\n<h2>First find the available best practice models<\/h2>\n<p>The first thing to do is to check for available best practice models. I do this by using the <strong>Get-BPAModel<\/strong> cmdlet and by not supplying anything else. This returns everything from everything as shown here.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-BpaModel<\/p>\n<p style=\"padding-left: 30px\">Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft\/Windows\/ADRMS<\/p>\n<p style=\"padding-left: 30px\">Company&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft Corporation<\/p>\n<p style=\"padding-left: 30px\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : RightsManagementServices<\/p>\n<p style=\"padding-left: 30px\">Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1.0<\/p>\n<p style=\"padding-left: 30px\">LastScanTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Never<\/p>\n<p style=\"padding-left: 30px\">LastScanTimeUtcOffset&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">SubModels&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">ModelType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : SingleMachine<\/p>\n<p style=\"padding-left: 30px\">SupportedConfiguration :<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft\/Windows\/CertificateServices<\/p>\n<p style=\"padding-left: 30px\">Company&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft Corporation<\/p>\n<p style=\"padding-left: 30px\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;: CertificateServices<\/p>\n<p style=\"padding-left: 30px\">Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1.0<\/p>\n<p style=\"padding-left: 30px\">LastScanTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Never<\/p>\n<p style=\"padding-left: 30px\">LastScanTimeUtcOffset&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">SubModels&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">ModelType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : SingleMachine<\/p>\n<p style=\"padding-left: 30px\">SupportedConfiguration : Win8<\/p>\n<p style=\"padding-left: 30px\">&lt;OUTPUT TRUNCATED&gt;<\/p>\n<p>For me, a better output is to look at the <strong>ID<\/strong><em> <\/em>and the <strong>LastScanTime<\/strong><em>. <\/em>This is because invoking the <strong>BPAModel<\/strong> requires the ID and because I want to know when the last time (if ever) the Best Practices Analyzer (BPA) model ran. Here is the command and the associated results.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-BpaModel | select id, lastscantime<\/p>\n<p style=\"padding-left: 30px\">Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LastScanTime<\/p>\n<p style=\"padding-left: 30px\">&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/ADRMS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/CertificateServices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/DHCPServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/DirectoryServices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11\/18\/2012 11:57:12 AM<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/DNSServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/FileServices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/Hyper-V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/LightweightDirectoryS&#8230; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/NPAS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/RemoteAccessServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/TerminalServices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/UpdateServices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/VolumeActivation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p style=\"padding-left: 30px\">Microsoft\/Windows\/WebServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Never<\/p>\n<p>To focus in on one specific best practices model, use the ID from the above output. I use the Clipboard to avoid a lot of typing. As shown here, the <strong>Invoke-BPAModel<\/strong> cmdlet does not appear to like wild cards.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Invoke-BpaModel -Id *dir*<\/p>\n<p style=\"padding-left: 30px\">Invoke-BpaModel: There has been a Best Practice Analyzer error for Model Id &#8216;*dir*&#8217;. The Model is not installed.<\/p>\n<p style=\"padding-left: 30px\">At line:1 char:1<\/p>\n<p style=\"padding-left: 30px\">+ Invoke-BpaModel -Id *dir*<\/p>\n<p style=\"padding-left: 30px\">+ ~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; + CategoryInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ResourceUnavailable: (:) [Invoke-BpaModel], CommandLetException<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; + FullyQualifiedErrorId : ModelNotFound,Microsoft.BestPractices.Cmdlets.RunScan Command<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>So, I use the Clipboard to paste the real ID name of the Directory Services BPA model to the <strong>Invoke-BPAModel<\/strong> cmdlet. This command is shown here along with the associated output from the command.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Invoke-BpaModel -Id Microsoft\/Windows\/DirectoryServices<\/p>\n<p style=\"padding-left: 30px\">ModelId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft\/Windows\/DirectoryServices<\/p>\n<p style=\"padding-left: 30px\">SubModelId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Success&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<\/p>\n<p style=\"padding-left: 30px\">ScanTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 11\/18\/2012 12:28:33 PM<\/p>\n<p style=\"padding-left: 30px\">ScanTimeUtcOffset : -05:00:00<\/p>\n<p style=\"padding-left: 30px\">Detail&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {DC1, DC1}<\/p>\n<h2>Retrieving results from the best practices analyzer<\/h2>\n<p>To retrieve results after running the <strong>Invoke-BPAModel<\/strong> cmdlet, use the <strong>Get-BPAResults<\/strong> cmdlet. The command is shown here.<\/p>\n<p style=\"padding-left: 30px\">Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices<\/p>\n<p>The output is extensive and, when unfiltered, goes on for page after page. This is because the cmdlet presents lots of information about each check. The results of the command and the first two checks are shown here.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5618.hsg-12-6-12-01.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5618.hsg-12-6-12-01.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>Well, I might not be an expert on the Best Practices Analyzer, but dude, I certainly know Windows PowerShell. So, I can fix this output easily. To do this, I first pipe the results to the <strong>Group-object<\/strong> and sort by the count. This way, I can get the &ldquo;executive overview&rdquo; and see the number of runs, hits, and errors.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | group severity -NoEle<\/p>\n<p style=\"padding-left: 30px\">ment | sort count<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Count Name<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8211; &#8212;-<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; 1 Error<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; 8 Warning<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; 34 Information<\/p>\n<p>Hey, that is not too bad at all. I guess I will look at the Error first. I filter it out by using the <strong>Where<\/strong>&#8211;<strong>Object<\/strong> cmdlet. Because I am using Windows Server&nbsp;2012, I have access to Windows PowerShell&nbsp;3.0 and, therefore, to the new <strong>Where-Object<\/strong> syntax. Here is the command I use.<\/p>\n<p style=\"padding-left: 30px\">Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | where severity -eq error<\/p>\n<p>Even the output from this one error is extensive. It appears (just a bit cut off) in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3058.hsg-12-6-12-02.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3058.hsg-12-6-12-02.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>After looking over the output, I decide I am only interested in the Title, Impact, and Resolution properties. The cleaned up output is shown here.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5226.hsg-12-6-12-03.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5226.hsg-12-6-12-03.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>From my previous command, where I grouped the results by severity, I saw there were eight warnings. I now want to examine them. I use the up arrow, and change <strong>error<\/strong><em> <\/em>to <strong>warning<\/strong>, as shown here.<\/p>\n<p style=\"padding-left: 30px\">Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | where severity -eq warning | fl title, impact, Resolution<\/p>\n<p>It might also be interesting to see the results by category. The following command shows that most of my results are configuration-related.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | group category -NoElement<\/p>\n<p style=\"padding-left: 30px\">Count Name<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8211; &#8212;-<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; 42 Configuration<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; 1 Operation<\/p>\n<p>If I am curious as to which report is related to operations, I use the following command.<\/p>\n<p style=\"padding-left: 30px\">Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | where category -eq &#8216;operation&#8217;<\/p>\n<p>To get a general overview of the warnings I have, I use the following command.<\/p>\n<p style=\"padding-left: 30px\">Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | where severity -eq warning | fl title<\/p>\n<p>The command and resulting list of warnings are shown in the following image.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4087.hsg-12-6-12-04.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4087.hsg-12-6-12-04.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>OK, it seems that a lot of the warnings are because I do not have a backup. How about if I filter out the &ldquo;backup noise&rdquo; and see what is left. Here is the command I use.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; Get-BpaResult -Id Microsoft\/Windows\/DirectoryServices | ? { $_.title -notmatch &#8216;backed up&#8217; -AND $_.severity -eq &#8216;warning&#8217;} | select title<\/p>\n<p style=\"padding-left: 30px\">Title<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8211;<\/p>\n<p style=\"padding-left: 30px\">All domains should have at least two domain controllers for redundancy<\/p>\n<p style=\"padding-left: 30px\">All OUs in this domain should be protected from accidental deletion<\/p>\n<p style=\"padding-left: 30px\">The domain controller dc1.nwtraders.msft should comply with the recommended best &#8230;<\/p>\n<p>&nbsp;There is more stuff related to the BPA module, and you can even download updated and additional BPA models. That is about it for now. Join me tomorrow when I will talk about more cool Windows PowerShell stuff.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><strong>Ed Wilson, Microsoft Scripting Guy<\/strong>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using the Windows PowerShell Best Practices module to audit configuration of servers. Microsoft Scripting Guy, Ed Wilson, is here. Well, tonight is the Charlotte Windows PowerShell user group. We are doing a mini version of the Scripting Games, and so if you are in the area, you [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[7,331,41,362,3,45,368],"class_list":["post-4505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-active-directory","tag-best-practices","tag-monitoring","tag-powershell-3","tag-scripting-guy","tag-windows-powershell","tag-windows-server-2012"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using the Windows PowerShell Best Practices module to audit configuration of servers. Microsoft Scripting Guy, Ed Wilson, is here. Well, tonight is the Charlotte Windows PowerShell user group. We are doing a mini version of the Scripting Games, and so if you are in the area, you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=4505"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4505\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=4505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=4505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=4505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}