The Surly Admin

Father, husband, IT Pro, cancer survivor

HTML Reporting – A Simple Cell Color Changer

As a follow-up to the ConvertTo-AdvHTML function, I have also written a much simpler version that simply changes the color of a cell.  The advantage to this script over the bigger ConvertTo-AdvHTML function is it works with current ConvertTo-HTML, or even HTML pages from other sources.  It also allows you the ability to set the criteria for the the color change.  Best of all it’s simple to use.

Continue reading

March 3, 2014 Posted by | PowerShell - HTML Reporting | , | 19 Comments

ConvertTo-AdvHTML – New Advanced Function for HTML Reporting

I love using ConvertTo-HTML.  There, I’ve said it.  The vast number of scripts I write are doing some kind of reporting function and the ability to create simple, fast, yet good looking reports with HTML has been a huge plus for PowerShell.  That said though, there’s definitely room for improvement.  ConvertTo-AdvHTML is an advanced function that addresses some of the current limitations with current cmdlet.  But this blog post isn’t going to a long explanation of how to use the new cmdlet, instead I wanted to write a script that actually used it.

Continue reading

February 27, 2014 Posted by | PowerShell - HTML Reporting | , , , , | 14 Comments

Parameter Sets

This has come up a couple of times and I’ve always managed to work around it, but there will come a time when you want to create an advanced function or script.  One with many parameters, and some of those parameters will be mutually exclusive.  You can do this using the ParameterSetName argument, inside the Parameter decorator.  Here’s how!

Continue reading

February 10, 2014 Posted by | PowerShell | , | 1 Comment

Ping Monitor

The other day I mentioned I was having a really bad day–that after being recognized turned into a really good day.  The reason it was though was because my shiny new firewall from Meraki was having all kinds of problems keeping a reliable site-to-site VPN with my co-host site.  The remote firewall was a Cisco ASA 5510 so you would have thought this wouldn’t be a problem!  But it was, and from it arose a need to create something that could monitor if my multiple subnets were routing properly.  The funny thing was I had recently helped another Spicehead with a similar script!  Now I needed it!

Continue reading

January 13, 2014 Posted by | PowerShell | , , | 1 Comment

More With Google Maps

Had a great time creating the Out-LastEarthquake.ps1 script, but let’s face it, other than it’s cool factor it doesn’t have much use.  But what we do have is the framework for the ability to place markers on a Google Map, and there are definitely some uses for that.  I created a proof of concept script that shows just what you could do.

Continue reading

January 7, 2014 Posted by | PowerShell | , , | 11 Comments

Creating Google Maps with PowerShell

You know, it’s funny how projects sometimes grow from something very small and become something quite different.  This is a story about exactly that.

Continue reading

January 3, 2014 Posted by | PowerShell | , , , | 6 Comments

Playing with Invoke-WebRequest – What is my IP Address?

Another script came through on Spiceworks here, and I liked the idea of it.  Not to mention I thought I could improve on it a bit using PowerShell.  It was also a good excuse to practice using Invoke-WebRequest which I haven’t had a lot of projects that use it!

Continue reading

December 21, 2013 Posted by | PowerShell | , | 2 Comments

Mapping Printers

Normally I’m a big fan of using Group Policy to map printers and network drives, it’s just so much easier to use and configure and anyone can do it.  No extra scripting knowledge needed.  And it just works.  Simple is best.  But sometimes it doesn’t and you need to go to plan B.  Mapping printers at work turned into just that situation and here’s how I solved it.

Continue reading

December 4, 2013 Posted by | PowerShell | , , | 3 Comments

Watch Exchange Mailbox Move Requests

Recently I’ve been involved with upgrading/migrating my Exchange server from 2003 to 2010.  It’s one of those projects where there aren’t going to be a ton of tangible benefits for my users and what with all of the other things going on at work I kept putting off.  But no more.  Let’s wrap this puppy up and move on.  Co-existence was configured for awhile but now I just needed to move the mailboxes in an orderly fashion.  We’re not a big company, but I’ve always kept a pretty liberal email retention policy so I’m paying the price for that now with large mailboxes and a lot of time needed to move things.

Read on to see how I used PowerShell to help me with this.

Continue reading

October 17, 2013 Posted by | PowerShell | , , | 11 Comments

SpiceWorld 2013

Really excited that I’ll be attending Spiceworld 2013 this year.  I’ve been using Spiceworks software since 2009 and been very active in their community most of that time but this is the first time I’ve attended their yearly conference.  I think it will be a great way to meet a lot of the people I’ve been interacting with for years but couldn’t tell you what they look like to save my life!

I’m also excited to be working with another Spicehead, Rob Dunn, on the Introduction to PowerShell 3.0 breakout session.  Rob and I are working hard to present PowerShell to beginners and hopefully cut down some of that initial learning curve that no doubt exists for newbies.  We really wanted to give a hands-on experience to learning PowerShell too, so no endless list of slide’s and lecture.  Our plan is to present 2, 3 maybe 4 slides than just sit in front of a PC and write a script with the whole group.  We’ll have to guide the script a bit as we only have an hour, but the idea is to present 3 different script ideas and let the group decide which script we’ll write.  From there we’ll show you how you can use PowerShell itself to help you write the script–bouncing from the shell to the ISE and back again until we have a rough little script written.

I’ve never done anything like this, and I’m thankful that Rob will be with me.  Rob has been with Spiceworks even longer than I have and written some great scripts.  His expertise is mostly with vbScript, which I think is really nice as he can bring that perspective to the PowerShell experience.  I’ve written quite a lot in vbScript too so it’s nice that we can speak the “short-hand”, without translating back and forth between languages!   It’s also been exciting that we both seem to have the same ideas–so far!–on what and how we want to do this so we can really focus on trying to bring the best and most interesting session we can.  Nothing worse than sitting there and having some guy sit behind a desk and drone on, essentially reading his slide deck to you!  This will NOT be that.  We’re going to be sitting with a PC on the screen writing the script with you.  Explaining why we do things the way we do them, and running into the same problems you would run into while writing a script and solving the problems right there.

So come down to Austin and join us at Spiceworld, find out what’s really happening in the world of the SMB and maybe learn a little PowerShell along the way.

October 14, 2013 Posted by | General, PowerShell | , , | 2 Comments