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! 🙂


New assignment, new challenges!

New year, new chances!

First of all, I’d like to wish everyone visiting my page a happy 2017 🙂

I hope everyone had a blast and is eager to learn some more in the new year.

As for myself, just before the year had ended, so did my previous assignment.
Luckily a new assignment was already in the works and I literally went to job A on Tuesday and job B on Wednesday.
This means new workplace, new technologies, new people etc.

Since I’m used to various different customers and technologies, the biggest thing was trying to figure out what they used, how they use it and then try and figure out which part of the technology I don’t know yet and get familiar with it.

What does this mean?

To my great surprise I had arrived at my new assignment to find out that this environment is one of the most up-to-date and neatest environments I’ve worked on so far!

Besides that, I saw various PowerShell scripts being used and technologies I haven’t played with or didn’t have the time to properly play with through PowerShell.
After being here for about 3 weeks now, I’ve come to learn that not all scripts seem to work properly, or should perhaps do more.
Another thing is that there are various technologies used where they didn’t even know how to use through PowerShell, so there’s a lot of fun times up ahead!

Some of the technologies I’ve already been playing around with are:

  • VMware ESX 6+
  • Citrix XenDesktop
  • Microsoft MDT
  • Exchange/Office 365 hybrid solution
  • Microsoft Azure

Of course besides the usual suspects like AD and general Windows functionality.

Now what?

Well, as you might’ve already noticed I’ve posted 2 MDT scripts recently to help me automate processes I have run into.

I’ve also been asked by various people already if I can assist them with scripting solutions, either helping them with their personal code or creating a solution from scratch.  Perhaps I’ll even see if I can provide a small training on basics of PowerShell and tips & tricks.

All in all, I’m quite happy with where I am right now and I hope to be able to script more on a daily base and provide blog updates of my results along the way!


For now, happy scripting all! 🙂



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! 🙂