Richard Siddaway's Blog

Archive for February, 2011

DevConnections–Connections powered by Microsoft

without comments

The conference is in London 14-15 June and includes a number of PowerShell related sessions. There is also a pre-conference PowerShell workshop on 13 June delivered by Don Jones. Details can be found here


I am hoping to arrange a PowerShell UG meeting with Don as the speaker while he is in London.  Details to follow.

Written by richardsiddaway

February 27th, 2011 at 10:04 am

Posted in PowerShellV2

UK PowerShell Group–March 2011

without comments

March 22 we have Tome Tanasovski presenting on Regular Expressions.


Tome is a Windows engineer for a market-leading global financial services firm in New York City. He is a recipient of the PowerShell MVP award, the founder and leader of the New York City PowerShell User group, a blogger, and a regular contributor to Microsoft’s Windows PowerShell forum. He has been featured four times on Hey Scripting Guy, and he is currently working on the PowerShell Bible, which is due out in 2011 from Wiley.


His session description:

Regular Expressions have been employed by every serious scripting language for the past 15 years. PowerShell’s adoption and implementation of Regular Expressions has ensured that it is taken seriously by serious scripters. The presentation will explore the history and syntax of regular expressions. It will give a deep dive into the PowerShell cmdlets that use Regular Expressions as well as the .NET native methods that can be invoked using PowerShell. It will give a detailed understanding of the internals of Microsoft’s implementation of Regular Expressions and how it differs from other languages. Real-world scenarios for using regular expressions will be explored.


Live Meeting Details:

When: Tuesday, Mar 22, 2011 7:30 PM (GMT)

Where: Live Meeting


Tome Tanasovski MVP presents on Regular Expressions


Richard Siddaway has invited you to attend an online meeting using Live Meeting.
Join the meeting.
Audio Information
Computer Audio
To use computer audio, you need speakers and microphone, or a headset.
First Time Users:
To save time before the meeting, check your system to make sure it is ready to use Microsoft Office Live Meeting.
Unable to join the meeting? Follow these steps:

  1. Copy this address and paste it into your web browser:
  2. Copy and paste the required information:
    Meeting ID: TRG55D
    Entry Code: Bd+;%:H8Z

If you still cannot enter the meeting, contact support

Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.

Written by richardsiddaway

February 27th, 2011 at 4:29 am

PowerCLI book

without comments

Last May I posted a review of fellow PowerShell MVP Hal Rottenberg’s book on managing VMware through PowerShell –

My good friends from the UK PowerShell user group Jonathan Medd (also a PowerShell MVP) and Alan Renouf have collaborated with three other authors to bring you VMware vSphere PowerCLI Reference which is published at the end of March – ISBN 978-0470890790

I’ll be posting a review as soon as I can get hold of a copy

More details from

Written by richardsiddaway

February 26th, 2011 at 8:17 am

Posted in Books

PowerShell Deep Dive

without comments

If you haven’t seen it already check out the PowerShell Deep Dive at this years “The Experts Conference”.

As well as total immersion in PowerShell you can dabble in some of the minor technologies associated with it – AD, Exchange, SharePoint, Virtualisation and the cloud.

I’ll be there with a bunch of other PowerShell MVPs. Hope to see you there.

Written by richardsiddaway

February 25th, 2011 at 1:25 pm

Posted in PowerShellV2

PowerShell and WMI–Chapter 5 MEAP

without comments

Chapter 5 has been released for PowerShell and WMI. It is available through the Manning Early Access Program (MEAP) at
The available chapters cover:

  1. Solving Administrative Challenges
  2. Using PowerShell
  3. WMI in Depth
  4. Best Practices
  5. System Documentation

Chapters 6 to 8 covering Disk Systems, Registry and the file system respectively are in the pipeline. I’m currently working on chapter 9 on the processes and services. The code to accompany the MEAP chapters is also available for download from the URL above.

Written by richardsiddaway

February 23rd, 2011 at 1:18 pm

Performance monitoring with Get-Counter

without comments

I last looked at the Get-Counter cmdlet back in 2009 when we were in the middle of CTP 3 for PowerShell 2.  its time for a revisit.

Gathering performance counter information provides a good look inside your systems to enable you to decide what is going on. If you look at the Performance Monitor utility you will see that there are a great many counters we could use. if you want to see them try running this

Get-Counter -ListSet *

A better bet is to start looking at the sets of counters

Get-Counter -ListSet * | sort CounterSetName | select CounterSetName –Unique

When we are looking at performance monitoring the list of usual suspects is fairly small:

  • CPU
  • Memory
  • Disk
  • Networking

These four areas usually start to define problem areas.  We can expand to other areas later.

CPU is always top of the list to look at. On my Windows 7 system I have Processor and Processor Information counter sets. Lets see what’s in them

PS> Get-Counter -ListSet Processor  | select -ExpandProperty counter
\Processor(*)\% Processor Time
\Processor(*)\% User Time
\Processor(*)\% Privileged Time
\Processor(*)\% DPC Time
\Processor(*)\% Interrupt Time
\Processor(*)\DPCs Queued/sec
\Processor(*)\DPC Rate
\Processor(*)\% Idle Time
\Processor(*)\% C1 Time
\Processor(*)\% C2 Time
\Processor(*)\% C3 Time
\Processor(*)\C1 Transitions/sec
\Processor(*)\C2 Transitions/sec
\Processor(*)\C3 Transitions/sec


PS> Get-Counter -ListSet "Processor Information" | select -ExpandProperty counter
\Processor Information(*)\Processor State Flags
\Processor Information(*)\% of Maximum Frequency
\Processor Information(*)\Processor Frequency
\Processor Information(*)\Parking Status
\Processor Information(*)\% Priority Time
\Processor Information(*)\C3 Transitions/sec
\Processor Information(*)\C2 Transitions/sec
\Processor Information(*)\C1 Transitions/sec
\Processor Information(*)\% C3 Time
\Processor Information(*)\% C2 Time
\Processor Information(*)\% C1 Time
\Processor Information(*)\% Idle Time
\Processor Information(*)\DPC Rate
\Processor Information(*)\DPCs Queued/sec
\Processor Information(*)\% Interrupt Time
\Processor Information(*)\% DPC Time
\Processor Information(*)\Interrupts/sec
\Processor Information(*)\% Privileged Time
\Processor Information(*)\% User Time
\Processor Information(*)\% Processor Time


These sets seem a bit similar.  We’ll start with the Processor counters. * means all instances.

if we look at the processor counters again

Get-Counter -ListSet Processor 

CounterSetName     : Processor
MachineName        : .
CounterSetType     : MultiInstance
Description        : The Processor performance object consists of counters that measure aspects of processor activity.
                     The processor is the part of the computer that performs arithmetic and logical computations, initi
                     ates operations on peripherals, and runs the threads of processes.  A computer can have multiple p
                     rocessors.  The processor object represents each processor as an instance of the object.
Paths              : {\Processor(*)\% Processor Time, \Processor(*)\% User Time, \Processor(*)\% Privileged Time, \Processor(*)\Interrupts/sec…}
PathsWithInstances : {\Processor(0)\% Processor Time, \Processor(1)\% Processor Time, \Processor(_Total)\% Processor Time, \Processor(0)\% User Time…}
Counter            : {\Processor(*)\% Processor Time, \Processor(*)\% User Time, \Processor(*)\% Privileged Time, \Proc essor(*)\Interrupts/sec…}


The Paths and PathsWithInstances properties of each performance counter set contain the individual counter paths formatted as a string. So lets look at them.

PS> Get-Counter -ListSet Processor | select -ExpandProperty Paths
\Processor(*)\% Processor Time
\Processor(*)\% User Time
\Processor(*)\% Privileged Time
\Processor(*)\% DPC Time
\Processor(*)\% Interrupt Time
\Processor(*)\DPCs Queued/sec
\Processor(*)\DPC Rate
\Processor(*)\% Idle Time
\Processor(*)\% C1 Time
\Processor(*)\% C2 Time
\Processor(*)\% C3 Time
\Processor(*)\C1 Transitions/sec
\Processor(*)\C2 Transitions/sec
\Processor(*)\C3 Transitions/sec


PS> Get-Counter -ListSet Processor | select -ExpandProperty PathsWithInstances
\Processor(0)\% Processor Time
\Processor(1)\% Processor Time
\Processor(_Total)\% Processor Time
\Processor(0)\% User Time
\Processor(1)\% User Time
\Processor(_Total)\% User Time
\Processor(0)\% Privileged Time
\Processor(1)\% Privileged Time
\Processor(_Total)\% Privileged Time
\Processor(0)\% DPC Time
\Processor(1)\% DPC Time
\Processor(_Total)\% DPC Time
\Processor(0)\% Interrupt Time
\Processor(1)\% Interrupt Time
\Processor(_Total)\% Interrupt Time
\Processor(0)\DPCs Queued/sec
\Processor(1)\DPCs Queued/sec
\Processor(_Total)\DPCs Queued/sec
\Processor(0)\DPC Rate
\Processor(1)\DPC Rate
\Processor(_Total)\DPC Rate
\Processor(0)\% Idle Time
\Processor(1)\% Idle Time
\Processor(_Total)\% Idle Time
\Processor(0)\% C1 Time
\Processor(1)\% C1 Time
\Processor(_Total)\% C1 Time
\Processor(0)\% C2 Time
\Processor(1)\% C2 Time
\Processor(_Total)\% C2 Time
\Processor(0)\% C3 Time
\Processor(1)\% C3 Time
\Processor(_Total)\% C3 Time
\Processor(0)\C1 Transitions/sec
\Processor(1)\C1 Transitions/sec
\Processor(_Total)\C1 Transitions/sec
\Processor(0)\C2 Transitions/sec
\Processor(1)\C2 Transitions/sec
\Processor(_Total)\C2 Transitions/sec
\Processor(0)\C3 Transitions/sec
\Processor(1)\C3 Transitions/sec
\Processor(_Total)\C3 Transitions/sec


These are the strings we need to use to collect performance information.


Get-Counter -Counter "\Processor(_Total)\% Processor Time" -MaxSamples 10

returns 10 samples 1 second apart showing the total processor usage

I have two cores in my system so I might want to see what the individual cores are doing


Get-Counter -Counter "\Processor(_Total)\% Processor Time", "\Processor(0)\% Processor Time", "\Processor(1)\% Processor Time" -MaxSamples 10

Next time we’ll look at memory

Written by richardsiddaway

February 22nd, 2011 at 1:59 pm

Windows 7 SP1

without comments

Installed the RTM version of SP1 today – its one download to cover Windows 7 and Windows 2008 R2.  Install is straight forward. No real issues seen.  I’ll report any problems that come up

Written by richardsiddaway

February 20th, 2011 at 1:31 pm

Posted in Windows 7

More date oddities

with 2 comments

I’ve mentioned before that if I do this


I get

09 October 2011 00:00:00

which is not what I expect as I live in the UK


Just been experimenting and discovered that

Get-Date "10/09/2011"


works correctly (for me) and returns

10 September 2011 00:00:00


It seems Get-Date picks up the locale and culture correctly but casting to [datetime] doesn’t.

Written by richardsiddaway

February 19th, 2011 at 1:25 pm

Posted in PowerShellV2

IT lemmings

without comments

IT seems to be in a continuous cycle of hype. We keep getting “new” technologies or ways of supplying IT that will solve all of your organisations problems at a stroke. Some examples of this phenomenon include:

  • outsourcing – IT isn’t a core activity for you business so hand over the running of your IT systems to a specialist company who have the experts to deliver what you need and the economy of scale to do it cheaper
  • virtualisation – You don’t need lots of physical servers. Virtualise so that you are running a number of big servers really hard and they host a bunch of virtual servers that are doing the work
  • web services – everything will be available as a web service. Don’t write your own code just string together a set of pre-supplied services and nirvana is reached
  • cloud computing – move everything to Internet access. Let the supplier host the application and you just use it (How is this different from the failed Application Service Provider idea of the late 1990’s?)

Now before you start jumping up and down calling me a luddite let me point out that I am currently working in a environment that utilises three out of these four concepts. I am actively designing new services that employ two of them.

My concern is the misinformation and hype that surrounds “new” technologies. I keep calling it “new” because a number of these are recycled. I’ve already mentioned ASP/Cloud computing. I was working with “virtualisation” technologies on mainframes back in the 1980’s. What goes around comes around.

Each wave of “new” technologies brings a bubble of hype that is totally out of proportion to the benefits to be gained. The IT analyst companies start the ball rolling and the IT press (who usually don’t understand what they are talking about) jump on the bandwagon. Suddenly, the only way your organisation can survive is to throw away everything that has gone before and embrace this new way of doing things.

Reality Check

How many organisations have completely virtualised their environment. I have applications that can’t be virtualised because the vendor won’t support it in a virtual environment?

How many external web services does you company really use?

Can you run your organisation in the cloud? Many can’t because of regulatory or commercial restrictions that prevent it. This is often due to access to the data.


All of the ideas that are bandied about need consideration. Just because its new doesn’t mean that it suits your organisation.

This is where the good architect earns their money. Separate out what will benefit your organisation and utilise it. Ignore the rest. ignore the analysts and IT press telling you what you should be doing when they don’t have a clue what your organisation really needs.

There are organisations that will benefit from cloud computing. There are others that it will harm. Virtualisation is delivering benefits to the organisation I work with – but don’t forget the overheads that come with it.

One of my favourite phrases when discussing technology is “so what”.  Meaning what does it actually do for us? Does the benefit of implementing out weigh the cost?

This continual jumping towards the next shiny toy is why many businesses hold their IT departments in such low regard? The planning should always be from business process to applications to infrastructure to support them. Leading with technology doesn’t work and will continue to cost businesses money they possibly can’t afford.

Written by richardsiddaway

February 12th, 2011 at 5:04 am

Posted in Architecture

Tonight’s Slides and recording

without comments

Thank you to everyone who attended tonight’s Live Meeting. Apologies for the sniffles, coughs and splutters but you were probably better off not being in the same room. Hopefully this cold will have gone before the next meeting.

As promised the here the URLs for the recording and the slides/demo scripts


Richard Siddaway has invited you to view a Microsoft Office Live Meeting recording.
View Recording
Recording Details
    Subject: Powershell utility cmdlets
    Recording URL:
    Recording ID: 5D2B4R
    Attendee Key: h_>SF*D9q


Slides and demo scripts available at

Written by richardsiddaway

February 8th, 2011 at 2:56 pm