Home > PowerShell > Invoking Best Practices Analyzer across the network

Invoking Best Practices Analyzer across the network

Recently while studying for my MCITP upgrade, I came across the ability to use Best Practice Analyzer (BPA) via PowerShell – and remotely.  This seemed like an amazing way to go through and do proactive checks on the systems to ensure that everything is as up to date as possible.  While it might not catch everything, the Microsoft BPA’s are very good at finding the low hanging fruit.

So I set about how to see about automating this and running it across the network…

I didn’t have to look long before I found this excellent post (http://blog.powershell.no/2010/08/17/invoke-best-practices-analyzer-on-remote-servers-using-powershell/#comment-1427) by Jan Egil Ring.  I don’t think I could have asked for much better.   The script itself is hosted at http://gallery.technet.microsoft.com/scriptcenter/84d3e608-1404-4ee9-b5e2-24452ecc8b94 and allows for one to “copy code” to capture it.  A quick caution here – don’t paste it into Notepad – I found this butchered the line breaks, and made it take forever to troubleshoot.  Pasting it into Notepad++ was near perfect first try.

The first portion of the script has some variables you’ll want to modify.  These set the location of the share the reports will save to, the mail server to use, the To/From e-mail addresses, etc.

I’ve tried making the share, but I’m not having any luck with anything but one of my DC’s able to save the reports to it, even with “Everyone” having full control to the share and NTFS.  My immediate gut feeling is that this is related to what account on the remote system is actually doing/running the remote PowerShell work.  However, the e-mail reports are working just fine, so I know it’s just some sort of permissions issue that I’ll fix over time.

Kudos to Jan!

Advertisements
Categories: PowerShell
  1. Javier
    February 24, 2013 at 11:54 AM

    Hey I am so happy I found your webpage, I really found you by accident, while I was looking on Bing for something else, Anyhow I am here now and
    would just like to say kudos for a marvelous post and a all round exciting blog (I also love
    the theme/design), I don’t have time to read through it all at the minute but I have bookmarked it and also included your RSS feeds, so when I have time I will be back to read much more, Please do keep up the superb job.

    • March 23, 2013 at 5:57 PM

      Thanks. I don’t think it’s any special theme, just one of the WordPress options that didn’t offend…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: