PowerShell Scripting Tip: Choose your tests carefully

There’s a lot that can be achieved in a little bit of PowerShell (a single (pipe)line, even), and that brings with it a tendency to throw a solution together quickly. As the saying goes, though, with great power comes great responsibility, so you need to be careful. Using -whatif and -confirm can help you to avoid hanging yourself, but you also need to do more thorough testing before you put a script into production (and yes, I’m talking to myself as much as anyone else here). For example, I have tripped over a problem (and I know others who have … Continue reading PowerShell Scripting Tip: Choose your tests carefully

PowerShell MVP for another year

My 2014 started out with the news that I’ve received my 4th Microsoft MVP Award for PowerShell, which contrasted wonderfully with the end of 2013 when I had a rather nasty fall and was lucky to not break a few bones (although I do still feel pretty sore). I’ve learned from experience not to bother making New Year’s Resolutions, but going forward I do have a plan to work smarter (see my last post on The Phoenix Project) and to take advantage of working in a tall building to get some exerise up and down the stairs!

PowerShell 4.0 DSC presentation at NEBytes

For those in or around North East England next Wednesday (28th August), I’m going to be doing a presentation at NEBytes on PowerShell 4.0, with a focus on Desired State Configuration. If you haven’t heard of DSC before, it’s a really big deal – a new set of cmdlets and language extensions provide the ability to declaratively specify the configuration of your environment and maintain the desired state of your systems. I’m going to cover what DSC can do for you, showing how to define and deploy configuration scripts, as well as touching on some of the other new features of PowerShell … Continue reading PowerShell 4.0 DSC presentation at NEBytes

2013 PowerShell Scripting Games

If you’ve read very much of my blog, you’ll know that I’m a big fan of the annual Scripting Games, where challenges are set for beginners and advanced scripters, to be solved in PowerShell. The reason I like this event so much, apart from enjoying a challenge, is that it’s an excellent way to learn, regardless of your level of proficiency. The great thing about the Scripting Games is that you can have a go at solving each problem and then see an expert solution to compare your efforts with. Even if you’re really competing at the advanced level, you’re … Continue reading 2013 PowerShell Scripting Games

Deleting AD Users with PowerShell – Why is a user not a leaf object?

I’ve been re-writing some automated processes around user account lifecycle recently, making use of the Active Directory PowerShell module on Windows Server 2012. Most recently this involved removing a large number of expired user accounts. On the first attempt of trying to remove the user objects I was receiving this error for a number of them, seemingly at random: Remove-ADObject : The directory service can perform the requested operation only on a leaf object So why would a user object in AD not be a leaf object? It turns out that when a user connects a device to Exchange with EAS, there’s an AD object created … Continue reading Deleting AD Users with PowerShell – Why is a user not a leaf object?

PowerShell Help Update

When PowerShell version 3 arrived, the news that there wouldn’t be any built-in help was initially met by a load of groans, since it had been one of the first things that anyone would tell you to look at when you’re trying to learn PowerShell. Since then, Microsoft has explained the problems with in-the-box help, and I think that most people have come round to thinking that updateable help is, on balance, the better option. This week we’re seeing the real-world benefits of that with the first significant update to the help. If you run PowerShell as administrator and run … Continue reading PowerShell Help Update

PowerShell Plus goes free!

Idera’s award winning integrated devlopment environment PowerShell Plus has dropped the price tag and is now free for anyone to download and use. As well as being a great tool for writing scripts and running PowerShell interactively, it’s comes with a boat load of code snippets and built-in learning resources for beginners as well as advanced features for power users. This isn’t an ad, just a genuine recommendation – check out the full feature list and download PowerShell Plus now.

Remote Server Admin Tools for Windows 8

If, like me, you’ve been keenly awaiting RSAT for Windows 8, there’s been a spot of confusion lately. Some people were declaring that the RTM tools were available even though the page was clearly labelled “Release Preview”, then the page disappeared from the Microsoft Download Center completely. Happily though, the wait is over and you can now download 32- or 64-bit versions: Remote Server Admin Tools for Windows 8 This is good news for people who want to use the new Server Manager to manage their infrastructure from their desktop (Windows Server 2012 will work natively, obviously, and you can … Continue reading Remote Server Admin Tools for Windows 8

PowerShell 3.0 for Windows 7 and Server 2008

Along with the launch of Windows Server 2012* yesterday, Microsoft released the Windows Management Framework 3.0 for some downlevel clients. In the package you get PowerShell 3.0, and updated versions of WMI and WinRM for Windows 7 SP1, Windows Server 2008 R2 SP1 and Windows Server 2008 SP2. If you were looking for support on XP and Vista you are out of luck. WMF 3.0 also contains the Server Manager CIM Provider that you’re going to need on your 2008 R2 SP1 and 2008 SP2 servers if you want to manage them with the new Server Manager in Windows Server … Continue reading PowerShell 3.0 for Windows 7 and Server 2008

PowerShell v3 on the Get-Scripting Podcast

Last week I had the chance to chat with Jonathan Medd and Alan Renouf on Episode 31 of the Get-Scripting Podcast, which is now available to download. We had a great time recording and covered a lot of ground with PowerShell version 3, so it runs long, but I hope you’ll get as much out of listening to it as we did recording it! During the recording, I mentioned some Quick Reference Guides, put together by the great guys at PowerShellMagazine.com, but hosted by Microsoft. Microsoft have added a couple more guides since I last looked, so you should definitely … Continue reading PowerShell v3 on the Get-Scripting Podcast