TechCenter Blogs

Microsoft Masterminds Episode 1: Jeff Wouters on the Power of PowerShell

TechCenter

TechCenter
DellTechCenter.com is a community for IT professionals that focuses on Data Center and End User Computing best practices. Here you can learn about and share knowledge about Dell products and solutions.

Dell TechCenter

Dell IT solutions brought into focus, from the network edge to the heart of the data center.

Microsoft Masterminds Episode 1: Jeff Wouters on the Power of PowerShell

  • Comments 1
  • Likes

Welcome to the first episode of tech talks with outstanding Microsoft community members. Most upcoming interviews will be with Microsoft Most Valuable Professionals (MVPs) but I am not limiting myself to those outstanding Microsoft tech experts. Take Jeff Wouters for example: Jeff is recognized by the Microsoft community as a PowerShell Magician – you want to learn why? Read on … and enjoy!

Interview transcribed & edited by Rafael Knuth

Me (left) talking to Jeff Wouters (right) in Hamburg, Germany during the E2EVC Conference 2012

Flo: Jeff, I am happy to talk with you! Can you tell us about yourself and about your work?

Jeff: I am living in Holland, my main focus is Hyper-V in SystemCenter and I ran into some limitations in the product, so I went to PowerShell. With a little bit of googling … sorry: binging … I was able to find a lot of documentation. The PowerShell community is huge, the information they share is even better, so I was able to create some easy scripts. Then I had two sessions with Don Jones, he is a PowerShell MVP … one session was about Active Directory management and one about PowerShell Remoting. I then saw the power of PowerShell and I was like: “I have to learn PowerShell!”

Windows Server 2012 and SystemCenter 2012 just came out, and I see PowerShell integrated into EVERYTHING. Basically, administration tasks are possible in the GUI … you can still click it. But for all the fun stuff you have to turn to PowerShell and … I love it!

Flo: Give us some examples of the power of PowerShell.

Jeff: When I started with PowerShell, I used it the wrong way.  I knew VB Script and then I started to use PowerShell code with the VB Script way of thinking.  For example, with VB Script it took me about 20 lines of code, with PowerShell it was still 18 lines. Then another Microsoft MVP Jeffrey Hicks showed me how to use the pipeline, switch statements and stuff like that … and suddenly 18 lines of code became three. Even those three lines can be trimmed down to one line if you like, but then the code will become harder to read and you have to know PowerShell really well to understand it.

Flo: What are the major improvements from PowerShell 2008 to 2012 … in my opinion it’s that the syntax didn’t change.

Jeff: Ok syntax … well (laughter). A little bit history. PowerShell version 1 had basically one error: “access is denied”. So PowerShell version 2 came with a lot more errors like the errors explaining what you did probably wrong and stuff like that, which was a very good improvement. Next, PowerShell came out with Remoting and all produts were suddenly using PowerShell Remoting. When PowerShell version 3 came out, you had PowerShell workflow, based on the Windows Workflow Foundation (WF). It will basically enable you to execute tasks in parallel, because natively PowerShell does things in sequence, and is very powerful with bulk tasks like 3,000 live migrations. You want do that in parallel preferably.  Further you have got member enumeration, which is an easy way to use properties to an object to create.

Flo: Have you ever used PowerShell web access?

Jeff: Only in demos, not in the production environment yet because my current customer doesn’t have a fully functional PKI infrastructure.  When I do this, I want to do it secure. Opening PowerShell to the big bad world is not a good idea. I know the power of PowerShell and with one command I can take your entire environment down if your Remoting is enabled. So that’s not something I want to give to everybody.

Flo: Do you use PowerShell script environment or Notepad?

Jeff: When I write a very big script, functions and stuff like that, I use either Primo Script or PowerShell Plus. For scripting together with other system admins who are not very fluent with PowerShell yet, I use PowerShell ISE in version 3 because it has intelligence and it makes things lot more easily. When I need to do some quick and dirty scripting, I use Notepad.

Flo: Is there something PowerShell can’t provide?

Jeff: It’s there something it can’t provide? (laughter). If anything can be done inside a product, it can be done in PowerShell! A lot of things are even removed from the GUI and the only solution is PowerShell.

Flo: Can you give an example, please?

Jeff: Yeah, take Hyper-V. You are able to use affinity to set virtual machines together on a node or … even anti-affinity to separate them from each other. Let’s say for example a SQL cluster with two virtual machines … you do not want those same machines on the same node. That’s where you use anti-affinity and you can only configure that through PowerShell. You can configure affinity through GUI but it’s a lot of clicking all over the place and anti-affinity is basically two, three lines of code.

Flo: Dell has many PowerShell Plugins and CLIs such as iDRAC and Power Center. Are you using such tools to integrate your environment with PowerShell?

Jeff: Let’s say … if I was a big system integrator and I was using Dell products for all my customers, I would script it once and make it a standard set up, deploy it at my customer site, hit my script … sit back, take some coffee … and when I finished my coffee my entire environment is up and running.

For most system admins I would recommend using SystemCenter. Lots of system admins currently do not understand PowerShell, they don’t want to and they will never do so in their opinion.

Flo: You should change that …

Jeff: That is exactly my challenge. In Holland, I am doing some workshops in the evening to make customers enthusiastic about PowerShell. I recently had a workshop with a company that does hosting, and they have more than 300 web servers … Windows Server IIS and they deployed them manually. They have an automated deployment through PXE boot but enabling those server roles, enabling IIS packages and importing them, that’s all done by hand! CLICKING! So I asked them to give me some of the packages, I prepared a demo and the entire writing of the script took me 40 minutes. Deploying it was: hitting enter and sitting back.  Right now I can use that single script, put the packages in a certain directory and … I wouldn’t say it’s universal … but any package you put in that directory, you save it there, you hit the script, you sit back and your package for the website would be deployed on all you web servers. So, it’s not 300 times clicking. It’s pressing enter, sitting back and you are done. All you have to do is preparation for the script and then the next thing is enjoying the coffee.

Flo: We should definitely catch up shortly … and show customers what PowerShell can do on Dell products.

Jeff: Yeah, sure!

Flo: Sounds good! Thank you very much and … talk to you soon.

Recommended PowerShell Resources

Jeff Wouters, PowerShell Magician

Twitter: @JeffWouters
Blog: http://jeffwouters.nl/

Don Jones, Microsoft MVP

Twitter: @concentrateddon
IT Pro Column: http://www.windowsitpro.com/topics/powershell-scripting/don-jones-on-powershell
Don’s Book on PowerShell: http://jdhitsolutions.com/blog/2012/11/learn-powershell-3-in-a-month-of-lunches-now-available/

Don’s Shell Hub: http://shellhub.com/

Jeffery Hicks, Microsoft MVP

Twitter: @JeffHicks
Blog: http://jdhitsolutions.com/blog/
PowerShell Communities

http://powershell.org/
http://powershell.com/cs/

To post a comment login or create an account

Comment Reminder

Unrelated comments or requests for service will be unpublished. Please post your technical questions in the Support Forums or for direct assistance contact Dell Customer Service or Dell Technical Support.. All comments must adhere to the Dell Community Terms of Use.

  • Very cool series. Looking FWD to upcoming interviews :-)