Script Dumpster: Find duplicate entries over multiple reports

Another day at the office..

Thanks to our friends who wrote the NotPetya worm, I received an email from our monitoring vendor to run reports to see if our machines are up-to-date on their patching.

Unfortunately their reporting tool doesn’t properly distinguish between Windows Server 2008 and Windows 2008 R2, as well as Windows 2012 and Windows 2012 R2.

Long story short,  I had to create 4 separate reports, telling me if I had or had not installed the proper KB item on each machine.

Because of this flaw I also had to join the reports and check the “Highlight Duplicates” option in Excel to see whether or not servers had their respective Hotfix installed (if the server had a duplicate entry, it meant that it didn’t have either the standard or R2 patch installed, meaning vulnerable).

Each report also came with a 3 row header with random junk that needed to be removed, so a simple Ctrl + A , Ctrl + C, Ctrl + V wouldn’t suffice.

PowerShell to the rescue!

I looked at the email from the vendor and went “Hell no, I’m not going to do that…” and opened up PowerShell ISE.

Having dumped the reports in the folder c:\Temp\NotPetya , I came up with the following script:

While the coding took a little bit longer, the execution was swift and perfect.

Geeks and Automation

 

Happy scripting! 🙂

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Script Dumpster: Copy your MDT Task Sequence

Ever have a Task Sequence in MDT which you customized and configured to use a specific driver profile, then having to create a second one just for another model and you have to copy everything over?

Well, I did and didn’t like it.

So according to Johan Arwidmark [if you’re into MDT and don’t already know this guy, get to know him!], this is possible in various ways.

Now while I used his approach, I didn’t like the fact that it wasn’t easily re-usable and I still had to provide various data myself.
And I’m lazy, so I don’t want that!

As mentioned in my previous MDT related post, do note that I have 2 important variables [MdtDrive & MdtRoot] configured within my PowerShell profile on my MDT server, so please make sure to also predefine these to use the script.

Happy Scripting! 🙂

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Automagically update your MDT Boot Image

In case you’re using Microsoft’s awesome Microsoft Deployment Toolkit [MDT] solution, there might be a thing you don’t often do, but can take up  a while of your time and can have quite some impact if you forget a few steps..

What I’m talking about is updating/regenerating your MDT Boot Images and replacing them within Windows Deployment Services [WDS].

Of course such a thing is ideally done through PowerShell as it automates and thus limits the amount of human errors possible.

Profile

An important thing in the script is currently ‘missing’ as it’s currently placed within my $profile on my MDT server, so I’ll also provide you this, as it’s important for actual usage:

It’s rather simple, but required in order to gain access to any of the MDT related PowerShell cmdlets.

Since I’ll use it for more than just this script, I’ve placed it within my profile.

The solution

Now it’s not ideal and I’m sure June Blender will have a word with me on my [currently] lacking help notes, I thought I’d share it anyways 😉

I’ll delve more into techniques used in the script in another post, but there’s a new trick or 2 that I’ve not yet discussed on my blog before which might be interesting to browse through.

 

Facebooktwittergoogle_plusredditpinterestlinkedinmail