Friday, December 24, 2010

PowerShell Jobs

I’ve just seen an interesting blog article, that shows using PowerShell Jobs to do a specific task in Forefront Identity Manager (FIM). This article was neat ins two ways.

First, even though I am not really an FIM guy, by looking at the script, I had a pretty clear idea of what the script would do. So while I am not clear on the details (just how big is a management agent, how complex is the import process, and what do I do with them anyway!), I can see what the script will do. This shows up a point I keep making to my PowerShell classes: learning a new product’s cmdllets is mainly about learning about how that product’s objects are surfaced (WMI, CMDLET, Provider, etc) and then what they are and what they are used for. The latter bits of this of course require product knowledge, outside of PowerShell.

The second thing neat about this article was how the author took a set of operations (importing several management agents into FIM). In terms of the importing, you could have written the script to not use just – just calling the script block directly  inside the loop instead of inside a separate job. This approach delivers parallelism that can speed up dramatically the time for a task to happen. But, it depends.

Each time you run a PowerShell job (whether in the ISE or console), PowerShell creates an instance of PowerShell.exe to execute the script or script block. This means that each job comes with a bit of overhead – process creation has CPU/IO/Memory requirements. But if you can run multiple tasks in separate processes, then with Window’s multiprocessing features, the jobs run in parallel and therefore a much shorter overall time. At least in theory!

As ever it depends. If the task being executed uses a lot or resources to actually execute, then having multiple tasks run in parallel therefore raises the resource utilisation. Specifically, with more than one or two ‘heavy’ tasks, you can find the system is paging heavily. This paging might actually end up slowing the execution down to the point where there the benefits of parallelisation are swept away by the paging costs.

A related issue is what I call the 3:00 wakeup test. If had to be woken up at 3:00 in the morning to have to fix this script, what would I make of it. Because the script is more complex, it might take me longer to work out what is going on (and therefore how to fix things).

So-this script illustrates something that can really improve the performance of certain tasks. But as ever it depends!

Technorati Tags: ,,

Saturday, December 11, 2010

Lync Server and PowerShell–a new forum

Over at Www.PowerShell.Com, there’s a new forum: PowerShell for Microsoft Lync Server. This is a forum where you can ask any and all your questions around using PowerShell and Lync Server 2010. As you may know, Lync Server 2010 follows in the foot steps of Exchange and other MS server applications in offering a complete PowerShell Admin experience.

For those of you who are getting into Lync, your basic administration can be done from the Lync Server Control Panel (a sliver light application that replaced the MMC console used in Office Communications Server and earlier versions of what we now call Lync. But for heavy duty admin, PowerShell, and the 543 cmdlets in the Lync Module are going to be your focus. I teach Lync in the UK and know that many of the admins I’ve taught thus far are going to struggle with PowerShell as many of them have little or no PowerShell background (with too many still living in the land where administration must mean doing it at the GUI).

So if you are getting into Lync, and are having trouble doing a specific thing – come on down. If you are a seasoned OCS admin, and a bit unsure on PowerShell – definitely come on over and ask your questions.

Friday, December 10, 2010

First PowerShell PowerCamp A Fantastic Success

Last Saturday (Dec 4th) a group of 29 hearty souls sat down at an absurdly early hour and began to experience the first ever weekend PowerShell PowerCamp. After a short intro from super-star technology writer and consultant Jon Honeyball, I took the floor and spent the rest of the guiding the attendees through PowerShell. I projected slides, did tons of demos, while the attendees typed along on their own laptops. We did take a few minutes out for coffee and lunch, but worked on into the darkness before gathering our senses and meeting for a lovely meal in a local pub. Sunday saw more of the same, with a most excellent presentation of the Managing Hyper-V with PowerShell by superstar ex-Microsoft superstar James O'Neil.

The attendees were from a variety of companies and backgrounds but all shared a desire to learn PowerShell. Unlike some of the folks I see in my general Windows courses, the PowerCamp attendees all see the value in PowerShell and also see the value, to their CVs and careers, of learning PowerShell. It’s clear that for some weekends like this are just the ticket!

Moving forward, I will be running two more PowerShell PowerCamp weekends. The next one is March 26-27 and will be held in York, England. Price and full details will be announced shortly. Watch this space!