Wednesday, September 28, 2011

PowerShell PowerCamp–November 5/6–Filling Fast

I first started advertising this event in August, with a blog post and some tweets. Since then, we’ve had a good response with 14 folks booked so far. At this rate, we may need a bigger room. I’m going up Saturday to check out the meeting room to ensure all is OK!

In the mean time,  here’s the details of the event:

What is it?

This fast paced weekend event covers all the key aspects of Windows PowerShell - from the command line and writing production-oriented scripts. We start with the basics including installation and configuration, formatting and providers and remoting. We then look at scripting, managing script libraries using modules, using objects, and finishing with the PowerShell features added into Windows. We finish with a look at PowerShell in the cloud and what’s coming with PowerShell 3.  The event will be all lecture, with the opportunity to type along with the tutor.

What is the Agenda?
Day 1 – The Basics
•  PowerShell Fundamentals – starting with the key elements of PowerShell (Cmdlets, Objects and the Pipeline) plus installation, setup, and profiles
•  Discovery – finding your way and learning how to discover more
•  Formatting – how to format output nicely – both by default and using hash tables and display XML
•  Remoting – working with remote systems using PowerShell’s remoting capabilities
•  Providers – getting into OS data stores via PSProviders
Day 2 – Diving Deeper
•  Scripting Concepts – automating everyday tasks including PowerShell’s language constructs, error handling and debugging (both from the command line and using an IDE)
•  Modules – managing PowerShell script libraries in the enterprise
•  .NET/WMI/COM Objects – working with native objects
•  PowerShell and Windows Client/Server – how you can use built in PowerShell cmdlets
•  PowerShell in Key Microsoft Servers - a look at PowerShell today in SQL, SCVMM plus a look forward to the future with SharePoint 2010
•  PowerShell and the cloud – this module looks at PowerShell in the cloud and how you can use PowerShell to manage cloud computing.
•  PowerShell 3 – this final module will show you what’s new in PowerShell V3, based on the the latest Beta of Windows 8

What will it cost?
The cost is £200 (+VAT at the prevailing rate) for the weekend. Meals and accommodation are not covered.

Where is the event going to take place?
The PowerShell PowerCamp will be held at Microsoft Cardinal Place, 100 Victoria Street in Victoria on the weekend of November 5/6 2011.

Who is the tutor?
The PowerShell Weekend PowerCamp will be delivered by Thomas Lee. Thomas is a veteran PowerShell MVP who has been involved in the PowerShell community since the very beginning. He provides training and consultancy around a range of Microsoft products, with a recent focus on PowerShell and Lync Server. Thomas runs PowerShell training courses around the world, and has been a speaker at conferences across the world for the past decade. His Twitter handle is DoctorDNS and he maintains two blogs (Under the Stairs at and PowerShell Scripts Blog at

PowerBeers after Class on Saturday
I'll also be leading the class across the street to the pub for a beer after we finish on Saturday. I’d be happy to buy the first round! You (and I ) will probably need by then!

Special Guest
I have arranged for a guest PowerShell advocate, Tom Arbuthnot, to come along and add some additional flavour to the event. Tom works for Modality, a great UK Unified Comms consultancy and will be looking both at PowerShell in Lync abut also at wider issues. He’s should be fun!

PowerBeers after Class
I'll also be leading the class across the street to the pub for a beer after we finish on Saturday. I’d be happy to buy the first round! You (and I ) will probably need by then!

What do I need to bring
You need to bring a laptop with at least two VMs pre-configured. The first should be a Server 2008 R2 domain controller and the other one a member server. And if you have access to the Windows 8 beta, bring along a Win8 VM for the look at PowerShell V3. The virtualisation software is not of concern – but you need 64-bit guest OS support. Thus you can use Hyper-V, VMware Workstation or Oracle’s Virtual Box.

Take Aways
After the event, I’ll provide you with a USB memory key with as many of the free PowerShell Goodies as I possibly can. Attendees will also get an NFR license to both Idera’s PowerShell Plus Professional and Quest’s PowerGui Professional.

How do I book?
Contact to book a place and to arrange for the invoice to be paid. Payment will need to be cash, cheque or bank transfer – I don’t take credit cards. I will need to limit the total number of attendees, so book now!

More Details
Continue to read this blog!!

I look forward to a few more bookings and two cracking days of PowerShell.

Monday, September 26, 2011

PowerShell V3 and Updateable Help

With PowerShell v2, the help information you can get using Get-Help is fixed. if there are errors in the help information, Microsoft is not going to up date them (until V3 ships). The logic is that PowerShell is a component of Windows and the Help text is not a critical or a security fix – thus we’re not gong to get hot fixes. And given the relatively high bar to bugs that are fixed by Service Packs (it has to be customer impacting - it’s tough to argue erroneous help information falls into that category), thus the only way with V2 to get updated help is to wait for V3.

One good thing Microsoft did do for Version 2 was to add the –Online switch to Get-Help. This switch has Get-Help open a browser window and navigate to the on-line help in TechNet. Since TechNet content can get updated when appropriate, this has been the work around – go online for the latest help information. And looking at the online help topics, there have been a number of changes and fixes.

This changes at V3. With PowerShell V3, Help can be updated mid-version using the appropriately named Update-Help cmdlet. When you first start up PowerShell V3 (CTP1!), you get only basic help material. If you type ‘Get-Help Get-Help, you see the following:


As you can see from this screen shot, PowerShell can’t initially find the help information. If you try to run Get-Help About_*, you get none of the help topic files listed. Finally, at least for now, the help link shown in the screen shot takes you to V2 help, which doesn’t really help that much (for the obvious reason that V2 shipped with help information fully implemented). But the screen shot does tell you more or less how to fix the problem – use Update-Help.

When you installed PowerShell V3 CTP1, you downloaded a .cab file from Microsoft then expanded it. When you did the expansion, you created a HelpContent folder which contains the necessary information. With CTP1, help information is localised into German (de-DE), US English (en-US), Spanish (es-ES), French (fr-FR), Italian (it-IT), Japanese (ja-JP), Korean (ko-KR), Brazilian Portuguese (pt-BR), Russian (ru-RU) and Chinese (both zh-CN and zh-TW). So long as your OS is one of these languages, then just use Update-Help specifying the UI culture and the Source path to the Help .cab files. For reasons I’m sure of yet, you seem to need to specify the –Force parameter in order to force PowerShell to update the help information (this may be a feature of the early CTP). Like this:


in the longer term, this is going to be a great feature – being able to update help on your local system as Microsoft makes updates. In the short term, I suspect this my cause some confusion.


I have been playing with this some more. And I have noticed slightly different behaviour from Update-Help if you run it in the ISE. Hmmm.

Thursday, September 22, 2011

Using PowerShell and WMI to Manage the Registry

For those of you who are very keen eyed, you may have noticed some posts on my PowerShell Scripts blog related to the WMI Registry Provider. I’ve been working on a PowerShell and WMI course which will be published by Plural Sight in October. As part of this, I have been playing with WMI and the Registry provider, which you can easily use via PowerShell.

Microsoft has implemented a nice registry provider withing WMI: the StdRegProv class in the ROOT\DEFAULT WMI class.  This class contains 20 static methods that enable you to perform any Registry action on a local or remote computer. You can access these in two ways, either using New-Object to create a new System.Management.ManagementClass object, specifying the path to the class to the constructor ("Root\default:StdRegProv"). Alternatively, you could use the [WmiClass] Type Accelerator, specifying [WmiClass]"Root\default:StdRegProv". Both return the class object, which contains a number of methods as shown here:

c:\> $x=new-object System.Management.ManagementClass "Root\default:StdRegProv"
c:\> $x.Methods | ft name


In effect you have four sets of methods:

  • Create/delete registry key (CreateKey, DeleteKey)
  • Enumerate a registry key or value entry (EnumKey, EnumValue)
  • Create, set or delete a value entry (Set<valuetype>Value, Get<valuetype>Value, DeleteValue)
  • Check security on a value/key (Check Access, SetAccessDescriptor, GetSDecurityDescriptor)

Each method is very easy to call, as you will have seen on my PshScripts blog. To manipulate the registry, you need to specfiy a registry Hive, a Registry Key, and where needed, a registry value. So to create a registry key, you could do this:

$HKEY_LOCAL_MACHINE = 2147483650
$Reg                = [WMIClass]"ROOT\DEFAULT:StdRegProv"
$Key                = "SOFTWARE\NewKey"
$Results            = $Reg.CreateKey($HKEY_LOCAL_MACHINE, $Key) 

In this case, you specify the  hive to create the key in by specifying a well known value, in case, 2147483650. The well known values are as follows:

HKEY_CLASSES_ROOT     2147483648
HKEY_CURRENT_USER     2147483649
HKEY_LOCAL_MACHINE    2147483650
HKEY_USERS            2147483651
HKEY_DYN_DATA         2147483654
With PowerShell, you first instantiate the class instance, which gets you an object on the local or remote machine. Then, you pass the static methods of htios class the values necessary. You always need to the specific well known numbers – in my example above, via a variable to the call the appropriate registry operation. The other paramaeters will depend on the specific call being made.
So to create a new MultiString regisgry value, below the key created earlier, you could do this:

$HKEY_LOCAL_MACHINE = 2147483650
$reg       = [WMIClass]"ROOT\DEFAULT:StdRegProv"
$Key       = "SOFTWARE\NewKey"
$ValueName = "Example MultiString Value"
$Values    = @("Thomas", "Susan", "Rebecca")
$Key       = "SOFTWARE\NewKey"
$reg.SetMultiStringValue($HKEY_LOCAL_MACHINE, $Key, $ValueName, $Values)

In this case, the code created a new MultiString value. There are no explicitly NEW methods on StdRegProv – you use a Set* method to either create a new value entry or change a value. With both getting and setting value entries, you use different methods depending on the specific value type you wish to manage (String, Multi—String, Binary, etc).  With removing a value, there’s only one method: DeleteValue.
One small thing to be careful of, DeleteKey, deletes the key specified and everything below it. So Deleting a key of “\” in most of the well known hives is probably not advisable.
All in all, it’s darn easy to use the StdRegProv class with PowerShell for all your registry manipulation needs.
Technorati Tags: ,,

Windows PowerShell Bible To Be Published Soon!

I am really pleased to see that the PowerShell Bible 2.0, from Wiley, is due to be published very soon.



This labour of love from Karl Mitschke, Mark Schill and Tome Tanasovski took a lot of time and effort. I’m so glad to see it finished and nearly in the shelves.

Feel free to visit any book seller and buy as many copies as you like. Once the book is published and I get my rather meager allowance of them, I will have a few copies to give away to those folks who attend my PowerShell Master Classes!

Tuesday, September 20, 2011

PowerShell V3 - Autoloading Modules

Autoloading is a cool feature in PowerShell V3. With Autoloading, PowerShell allows you to ‘see’ cmdlets included in module without you needing to explicitly loading the relevant module. And when you need to run the cmdlet, the module is loaded automatically by PowerShell.

For example, if you run Get-Module on a newly opened PowerShell V3.0 CTP1 prompt, you get the following:

PSH [C:\foo]: get-module

ModuleType Name ExportedCommands
---------- ---- ----------------
Manifest Microsoft.PowerShell.Core {Add-History, Add-PSSnapin, Clear-History, Connect-PSSession...}
Manifest Microsoft.PowerShell.M... {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest Microsoft.PowerShell.U... {Add-Member, Add-Type, Clear-Variable, Compare-Object...}


if you then run a cmdlet contained in a module (e.g. Get-CimInstance), then re-run the Get-Module, you see the relevant module has been autoloaded, like this:

PSH [C:\foo]: Get-CimInstance win32_bios
Manufacturer      : Dell Inc.
Name              : Default System BIOS
SerialNumber      : 804HWM1
Version           : DELL   - 6222004

PSH [C:\foo]: get-module

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   CimCmdlets                {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSessio...
Manifest   Microsoft.PowerShell.Core {Add-History, Add-PSSnapin, Clear-History, Connect-PSSession...}
Manifest   Microsoft.PowerShell.M... {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest   Microsoft.PowerShell.U... {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

As you can see, PowerShell automatically loaded the new CimCmdlets module as needed. This is a neat feature.

One proviso  - autoloading does not appear to work with script modules. Sad smile

PowerShell Version 3–First CTP is available NOW

The first beta version of PowerShell 3 is now available to the public. To give it it’s full name, Microsoft today released the Windows Management Framework 3.0 Community Technology Preview (CTP) #1. This allows you to install PowerShell 3.0 onto systems running Vista/Server 2008 and later  Windows 7 and Server 2008 R2. So if you want to play with PowerShell 3 but are not yet running a Windows 8 version, this is the package for you.

To get the ‘bits’, navigate to the Microsoft Download centre where you can pick up a .cab file for either a 32-bit or 64-bit version of Windows. To install it, you must first expand the cab file using the Expand utility, then you run WINDOWS6.1-KB2506143.MSU.

Running the Windows patch, you are asked to accept the EULA (as per most installations these days) and the installer just does its stuff. For reasons I can’t explain this morning, the installation requires a reboot.

Once you reboot, you can see the new version of PowerShell


I’ve got a lot more to tell you, but I want to get his posted now prior to a long flight. I’ll post more later today on this new version of PowerShell

Technorati Tags:


[Later] Re-reading the documentation, this version of WMF is not supported on Vista or Server 2008, but only on Windows 7 and Server 2008 R2.

Sunday, September 18, 2011

The Build Videos–Getting Them With PowerShell

I’m just back from the //BUILD/ concerence in Anaheim – where I missed far more sessions than I could have ever hoped to attend. It was 3 1/2 days of the fire hose – I get tired just thinking about it. Luckily for us, Microsoft has taped every session and has put them up for download.

By day 2, superstar PowerShell guru James Brundage had created a great PowerShell function to download the whole set.

Get-EnclosureFile -Directory $home\Videos\Build -Feed

function Get-EnclosureFile  {
        Downloads enclosure files from a feed
        James Brundage
        Downloads enclosure files from a RSS feed using the BitsTransfer module
        Get-EnclosureFile -Directory $home\Videos\Build -Feed

# The directory where the files should go
# The Feed

begin {
Import-Module BitsTransfer –Global

process {
New-Item -ErrorAction SilentlyContinue $directory -ItemType Directory
Push-Location $directory
$Rss =(New-Object Net.Webclient).DownloadString("$Feed")
$xfer = $Rss |
    Select-Xml //item/enclosure |
        ForEach-Object {
            $url = [uri]$_.Node.Url
            $destinationFile = $_.Node.ParentNode.Title
            foreach ($char in [io.path]::GetInvalidFileNameChars()) {
                $destinationFile = $destinationFile.Replace("$char", "")
            $destinationExtension= $url.Segments[-1].Substring($url.Segments[-1].LastIndexOf("."))
            if (-not (Test-Path $destinationFile)) {
                Start-BitsTransfer -Source $url -Description $_.Node.ParentNode.Title -Destination "${destinationFile}$destinationExtension"


To call the function, just do something like this:

Get-EnclosureFile -Directory $home\Videos\Build -Feed

Of course, you better have a lot of disk space (I’ve taken up 21GB so far!). Oh – you also need a reliable connection (and you have Windows Bloody Update not decide to reboot).


Saturday, September 10, 2011

Lync PowerShell Support forum on PowerShell.Com

For those of you who are using PowerShell with Microsoft’s Lync Server, there’s a additional place to ask questions – and get answers. Namely the Lync PowerShell forum on It is one of the two forums I moderate on and I am ably assisted by superstar Lync MVP Marshal Harrison.

The Lync PowerShell forum is a place both to hang out and to ask (and answer) questions. Some for those of you learning PowerShell along with Lync, hope to see you there.

And for those of you with Twitter accounts, why not Tweet about this forum!

Lync 2010 Resource Kit is Released

The Lync Server 2010 Resource Kit is a technical reference to Lyn Server and extends the planning, deploying and managing documentation in Microsoft’s Lync Technical Library.

After a number of months in preparation, the Lync Server 2010 Resource Kit has been published – and you can download it for free from Microsoft. The book has 18 chapters and you can download each one from the Microsoft Download Center.  And from the same page, you can also get a single zip file with all the documents.

If you are interested in Lync, then these documents are a must read.


Technorati Tags: ,

Friday, September 09, 2011

Just when you think it’s safe to move to the cloud

I currently use those very nice people at CobWeb for my email service. I have a singe user account, utilising Exchange 2007 (2gb mailbox) which costs a mere £6.00 a month.  The service from CobWeb, for mail, has been outstanding – not a single noticeable glitch in over a year. It took a couple of days to get mail flowing when I first signed up, due to long DNS, but that was quickly resolved. Since then, it’s been flawless. And that’s the level of service that I guess I expect. Not being able to get to my mail is, as someone who is self employed, simply bad news!

I’ve been playing with Office 365 and am very impressed with the overall service – for not much more money than I currently pay, I could move up to a 25gb mailbox (not that I actually need such a large mailbox, but it’s the principle!), and get SharePoint and Lync thrown in. It’s Lync that is especially interesting – the new Lync client is so good, that I’m tempted to move just for that!

Then I read this:

While this explains the downtime, I suppose you could argue that a couple of hours downtime is no big deal especially as it took place overnight. But look at the Office 365 service’s reliability record since GA at the very end of June – it was down briefly in August, then again this week. In just over 2 months of live service, two outages in 2 months. 

Of course, Microsoft is not alone in having challenges. Google had an outage this week as well. And in April, Amazon’s infrastructure failed taking down a number of sites, including Foursquare.

So is this latest outage just a bit of teething/growing pains on the part of Office 365 or something else? I remember the trials and tribulations Demon had in the very early days – scaling massively a service that’s growing massively is very hard work! So, I suspect it’s a combination of factors. Certainly, developing and delivering scalable and highly reliable solutions, especially to Internet scale, is just plain difficult. Things that probably shouldn’t go wrong do – at least until there’s enough experience to make those problems a thing of the past. So I feel that at least a goodly portion of the ‘blame’ must lie in growing pains – which one would expect (hope) die off.  Certainly taking the latest and greatest versions of the software has risks. Cobweb is still running Exchange 2007 while O365 is using Office 2010 and related servers. But the features are so much better, I hear you say!

In my view, Microsoft released Office 365 a tad early. The outages, the problems with federation with Live, and of course the still missing PowerShell cmdlets for Lync Online and SharePoint online do not make for a perfect story. And I’d really have liked to see a full voice solution in terms of Lync online (but I know that such a feature is likely to reveal a number of challenges both technical and legal). The  outages (yesterday’s and the one in August) and lack of tools would have been noteworthy but not complaint worthy had the service still been in beta.  Maybe Microsoft should have considered a longer beta? I certainly think another 6 months would have been appropriate and might have enabled Microsoft to get better at running this vast service.

So what’s to be done. Certainly, as the BBC article points out, “the number of high profile failures have dented confidence in cloud computing”. But I do believe that eventually, MIcrosoft and the rest of the cloud vendors will get it right and we will see cloud computing as an everyday thing. I suppose it pays to be cautious. I’ve put on hold my plans to move my business email to Office 365, but I’m watching things carefully.


Technorati Tags:

Thursday, September 08, 2011

Hyper-V in Windows 8

Microsoft have announced some more details of Hyper-V in Windows 8 in the Building Windows 8 blog:

There are two really exciting things about this. First, Hyper-V is included in the Windows 8 client – I don’t have to have Server loaded to run it. That is going to be huge news to those folks using the client as their workstation/laptop/desktop. We can get rid of the rather poor VPC 7 product (and of course stop using Oracle/VMware).

The second really cool thing is that Hyper-V will support wireless adapters. This is a huge benefit for those of us on the road using Wireless everywhere. I have  new laptop with an 802.11N wireless adapter that I will now be able to use. I can’t wait to upgrade my laptop to Win8!!

These are both welcome additions – I can’t wait to get my hands on the beta next week at BUILD!

Technorati Tags: ,,

Office 365–A nice E-Book and an update on PowerShell Support in Office 365

Microsoft released Office 365 to General Availability at the end of June 2011. It’s been a couple of months since that happened and I’ve just noticed two things.

First my good friend Katherine Murray has released a free eBook from Microsoft Press. You can find details of the book here. And to download the book, just click here. The book is 299 pages long and covers the full set of features contained in the shipping version of Office 365. One small omission, IMHO, is that there is no coverage of PowerShell for administering Office 365. Having said that, MS Press have indicated that updates to the book “will become available in the future” – so perhaps we’ll see more PowerShell Coverage soon. Having said that, the book looks complete and I am keen to work though the contents learning a bit more about, in particular, SharePoint! Good job Kathleen.

Following on from that, the announcement of the book encouraged me to look again at the use of PowerShell in Office 365. Frankly, I’m somewhat disappointed – the situation hasn’t really changed since I wrote about it in April. At present there is support for a set of general Office 365 cmdlets, which my good friend Jan Engil Ring has described in his blog here. As you can see from that blog post, you can download the Microsoft Online Services module from Microsoft as either 32-bit or 64-bit. There is also support for Exchange online – the code I used my April blog post still works just fine – and gives you 229 cmdlets to manage Exchange online.

Sadly, there is no PowerShell support for either SharePoint Online or Lync Online. IMHO, this is just another indication that Office 365 shipped before it' was really ready. Hopefully we’ll see these cmdlets emerge soon – but there is nothing official other than they ‘will come later’.

In summary, Office 365 is maturing, with some good documentation and some limited PowerShell support. With a bit of luck, the additional PowerShell cmdlets and support will come sooner rather than later – I’ll be sure to blog when I find it!!

Technorati Tags: ,

Tuesday, September 06, 2011

Build Conference Getting Closer

The build up (forgive the pun) to the Build conference is slow but relentless. For those not in the know, Build is Microsoft’s upcoming developers conference around Windows 8, the next version of Microsoft’s Desktop (and Server) operating system. Although due out till 2012, until recently details of what’s coming have been scarce.

As I’ve blogged previously, Microsoft is slowly releasing details of what will make it into Windows 8, albeit in a verbose and rather opaque fashion (not dissimilar to how they handled Windows 7). The Build conference is intended to be where Microsoft open the Kimono, but if the current agenda ( is anything to go by, details in Anaheim will be thin. We’ll have to see, although having taken millions in conference fees, it’s rather sad that Microsoft can’t be a little more open about who’s speaking, when, and about what.

Microsoft has also been blogging about the contents of Windows 8 at There’s a very low signal to word ratio – lots of words, but not a lot of meat yet. The blog claims to be a dialogue, but so far, it’s been a monolog. Each blog post has generated a LOT of comments (the Improvements in Windows Explorer article, for example, has generated 1175 comments thus far!). But the number of responses is low – which I suppose is to be expected given all the comments. Also, given the blog engine being used, it’s really hard to see any thread/conversation. The comments are all sequential. I also note that some comments are being deleted – I’ve posted two comments that have somehow vanished.

Build should be a good event – for me at least it’ll be a chance to socialise with a bunch of friends. And given how cold and wet England is this year, a little south California sunshine is most welcome!

See you at Build!