This blog post is meant for both the PowerShell newbie and scripter out there looking for a reason why they should start learning aptly named PowerShell or push themselves to learn a new aspect of PowerShell they’ve been meaning to try.
It’s been a few years now since PowerShell first came to be. Remember those Monad days when we first got a glimpse at what Microsoft had up their sleeve? I’ll admit I was one of the skeptical ones, deeply entrenched in VBScript, DOS batch files, AutoIT, VB.Net, etc. I thought to myself, “Great, another programming language. This will never catch on. Microsoft did what to the administrative interface?!” I just didn’t get it at first.
When Exchange 2007 hit the market I knew they were serious. Microsoft cleverly led me (although initially it felt more like ‘forced me’) to learn this new scripting language by including helpful syntax examples whenever I would use the Exchange Management Console to do simple and sometimes complex tasks:
For example, moving a mailbox:
‘contoso.com/Test/Test Account1’ | move-mailbox -TargetDatabase ‘E2K7SVR1\First Storage Group\Exchange2007DB2’
Ok. That was simple enough and looking at the code, somewhat easy to follow the logic although at the time I didn’t have any clue what the syntax rules were yet or how to do anything I was used to doing with VBScript. Ah, my cherished VBScript. Not anymore! Fast-forward a few years later.
I can barely recall any scripts I wrote in VBScript let alone how to even write a simple one anymore. I can barely spell it nowadays. I look at scripts I’ve used and wonder how I got anything done. So many lines of code for what seemed like an easy thing to do. After my first go around with Exchange 2007 and PowerShell, I haven’t looked back. I scoured the web for any material and examples I could find on PowerShell. From sample code to concepts, from simple loops to functions, from standard console scripts to GUI-interfaces. Pretty soon I had a fairly solid understanding of just how (pardon the pun) powerful PowerShell really is.
The seemingly endless lines of VBScript quickly turned into one-liners. How awesome is that? As a former Exchange admin it was a blessing for sure. You could now take those seemingly daunting tasks your boss or HR would throw at you and knock them out in a matter of minutes.
So, what have I done with PowerShell since way back when? Well, I use it practically every day. I’m always looking for new and interesting ways to code with it. I am, however, very practical and spend the most time coding with PowerShell when I have a clear goal in mind, something I’m trying to solve for myself or my clients. For me it always stems from a problem I’m trying to solve for a client or developing new tools for my teammates. There is a lot of information out there today as compared to a few years ago. There’s tons of blogs, books, editors, and snap-ins you can sometimes download for free. The Quest ActiveRoles Management Shell for Active Directory is/was one of my favorites. I used that one in my job a lot for making bulk operations on AD objects a breeze.
Since I’m an Exchange and migration guy I am always looking for ways to make migrations easier. PowerShell helps me do that very easily. A few years back when BPOS (Business Productivity Online Suite) first came out there were literally only 5 PowerShell cmdlets you could use to manipulate cloud objects. Yeah, I know. Not a lot to work with. Well, a client was looking for an easy way to manage their cloud objects from resetting passwords (pre-ADFS and O365), reporting on their licensing, activating accounts and setting mailbox permissions. Of course my first inclination was to give them some PowerShell scripts but then realized I needed to make it easier. I really wanted a graphical interface for them. After hunting around I found the Sapien PrimalForms product (now known as PowerShell Studio). I literally spent weeks teaching myself how to use the product but I was able to give the client what they wanted, a simple graphical interface to help their support staff fend off the support calls after their migration to the cloud.
From there I did some custom updates to the product and we used it at different clients. Everyone loved it. But then Office 365 came around and offered a lot more cmdlets plus a decent web portal so I left my app on the shelf for a while, just providing support for those that still used it until their transition to O365 was complete. I did get a call to update the version to support O365 so I did. Here’s what it looks like now. There’s not a lot of features simply because I feel most of the benefits are already available in the portals and cmdlets. Nevertheless, it still has some useful things it can do to make someone’s job a little easier. Sure, the interface could be improved upon, more features could be added, and more “fill in the blank” could be done.
Here are some examples of what I’ve been doing with PowerShell:
My point is that you too can and should be creating some really cool scripts of your own. Even if they are for your own use, learning everything that PowerShell can do can be exciting and rewarding. There are so many facets to PowerShell and with version 3.0 and Windows Server 2012 there are thousands of new cmdlets and features to take advantage of. Windows Server 2012 is said to be one of the most automatable versions of Windows Server yet. PowerShell has even found its way into other MS products like SharePoint and Lync plus 3rd party vendors are including modules and snap-ins to work with their products. The PowerShell 3.0 feature I’m trying to get my head around now are the workflows and running processes in parallel.
So, now I get it, Microsoft. Thanks.
Until next time.