Thursday, 24 December 2009

Doesn’t time fly…?

So I’ve posting to this blog for 12 months now, having started on last Christmas Eve.  I have no idea whether anyone has found anything I’ve posted useful or just entertaining, although my ClustrMap indicates that a few people from various places around the globe have stumbled across my blog either on purpose or by accident (well, if I’m being honest it’s probably the latter, and when I say ‘people’ what I probably mean is automated web-crawling bots…).

So I’m still stuck at work until the bitter end but there’s a very relaxed atmosphere about the place, so there’s not a lot of real work being done.  That said, I did rebuild a WSUS server this morning.  Perhaps this afternoon when time is really dragging I may pass the time with a bit of Quake Live.

So Merry Christmas to anyone who may come across this, and as there’s still a bit of snow around here we may even get a white one after all…

Monday, 21 December 2009

So you work in IT…? #2

As I’ve said be before, being an IT Consultant automatically means that I’m also expected to know how to fix anything that has display and buttons for user-input.  So the conundrum put to me at the weekend was why a newly purchased Sony DVD-recorder/Blu-ray player wouldn’t play said Blu-ray disks.  Sometimes when troubleshooting, despite all your instincts, you have to get back to basics.  After a few moments the cause was quickly identified and after steeling myself to update the person concerned I took a deep breath and said to them “It’s not a Blu-ray player…”.  Despite their initial protestations, after pointing out..

  • The lack of Blu-ray logo on the device & packaging,
  • And that the manual didn’t list Blu-ray as a supported playback media,

..it was found quite funny all round (probably more so for me!).  But then they remembered that they had asked for a load of Blu-ray films for Christmas…

Wednesday, 16 December 2009

A bit of light reading…

On and off over the last couple of weeks I’ve been reading Memory Dump Analysis Anthology, Volume 2 by Dmitry Vostokov.  While I was in Berlin at TechEd I attended a session on Crash Dump Analysis presented by Daniel Pearson of David Solomon Expert Seminars which proved how much I don’t know about it (I’m okay with !analyze –v or basic stack trace diagnosis but there is obviously so much more that I don’t know yet) so I thought I’d read up on it.  The book is proving really interesting and I’ve already picked up a couple of things that I didn’t already know but it’s pretty heavy going in terms of raw-geek content (even for me!).

For an idea of what sort of content to expect check out the website.

Tuesday, 15 December 2009

Defragmenting drives with PowerShell: updated

A while back I posted about how it was possible to defrag a disk with PowerShell but ended the post saying that I would probably never need to use it.  Turns out that I did need to after all…

It had been quite some time since I’d defragmented either the drive in my main PC at home or any of the external hard drives connected to it.  What I wanted to to be able to do with a PowerShell script was:

  1. Identify all local hard drives,
  2. Work out how defragmented the drive is,
  3. Defrag the drive,
  4. Show how much less it is fragmented afterwards,
  5. Log it all to a file
  6. Then shutdown the PC (given that if I’m sitting in front of this PC I tend to be playing Team Fortress 2 I wanted it to run when I’d finished then shut the box down.  I know that defrag will fall back into the background if it detects that the user is doing anything but given my n00bTF2 skills I can’t afford to hamper my performance!).

Using the code I posted previously as a starting point, turned out that it was pretty easy to achieve everything I wanted the script to do…

image

  1. Identify all local hard drives using Win32_Volume class, checking that DriveType equals 3 (a local drive) and that there is a drive letter assigned,
  2. then use the Win32_DefragAnalysis class to work out how fragmented the drive is,
  3. then use Defrag Method associated with the Win32_Volume class,
  4. repeat step 2,
  5. Log it all using the start-transcript and stop-transcript cmdlets,
  6. and finally shutdown the PC using the stop-computer cmdlet.

This will only run on Vista and later and needs to be run elevated, but it means that I can defrag my drives and shut my PC down without having to leave it on and rely on scheduling and it’s one less excuse I have for being beaten on TF2 again….

Friday, 4 December 2009

SCCM SP2 gotcha (sms_def.mof)

Last week I upgraded the SCCM servers here to SP2.  There were a couple of reasons why I thought it would be a good idea, among them the fact that there have been some improvements to clients working with advertisements and also that there are now reports that will indicate how much of your managed PC estate can (or cannot) be expected to run Windows 7.  One thing that did almost catch me out was that a while back I made a change to enable the capture of environment variable info from client PCs through enabling Win32_Environment in sms_def.mof as below:

image

What happened during the upgrade to SP2 was that that although my amended copy of sms_def.mof got backed up the changes I had made weren’t reapplied to the new file…

 image

Okay, it wasn’t that onerous a task to re-enable Win32_Environment but I’d have been happier if I hadn’t had to do it at all….

Friday, 20 November 2009

Preventing boredom with numbers (and PowerShell) #3: Maths magic…

I recently read an article in the paper version (how old fashioned!) of Wired that told how you could impress friends and colleagues with a simple number trick:

Get someone to think of a number, ask them to double it, add 12, halve it, then subtract the number that they started with.  You can then amaze them by telling them that the answer is 6!

Obviously I wanted to prove this theory so I knocked up a PowerShell script that does the same calculation for each number between 1-100000 (it was originally a one-liner but I added line breaks here for readability)…

$y=1;

do{$x=((($y*2)+12)/2)-$y;"Start with $y, end up with $x";$y++}

while ($y -le 100000)

Okay, so it’s not the most useful bit of PS but at least you’ve got a bit of mathematical magic to impress people with…

 

Thursday, 12 November 2009

TechEd 2009: Day 4

So I was wandering around the exhibitors hall and was passing the Microsoft shop and sat outside looking decidedly bored was none other than Mark Russinovich who was patiently waiting to sign copies of his co-authored book Windows Internals 5 should anyone have decided to purchase a copy (the shop were offering a whole 25% of the list price, can’t think why there wasn’t a bigger uptake…).  Anyway I went up to him, said ‘hi’ and told him how good I thought the book was and that I wish I’d brought my copy with me was (I’d already bought mine not long after it was released).  What made me smile was that here was someone with Technical Fellow status, probably on a pretty good salary from MS, sitting there waiting to sign copies of his book.

Today has been another pretty geeky day: started off by warming up with a level 300 Group Policy/Windows 7 session, turned it up a notch with some deep-dive Windows Performance Troubleshooting & Analysis, then a level 400 Group Policy Troubleshooting session….and break for caffeine…level 400 on fixing application compatibility problems and then to wind down at the end of an intensive day…’Pushing the Limits of Windows’ presented by Mark Russinovich, again a level 400.   My brain hurts…..but I soon forgot about that as soon as they started serving food and drink the Community Drinks event.  Mmmm, beer and currywurst.

Unfortunately due to Father Ted Airlines bringing the flight time forward I’ll miss pretty much all of the last day of the conference except maybe having time for a hands-on lab first thing (although the conference does close at 14:15 so maybe it’s not that bad).  A real pity as just like the last two years I’ve been lucky enough to attend it’s been brilliant as it’s such a unique event that offers the kind of deep-dive training you just would never get attending a typical course in the UK plus you get direct access to the MS Product managers who are responsible for the products you work with day-to-day.

Downsides?  Well, we had to share the event with developers ;-)  Small price to pay I suppose…

Wednesday, 11 November 2009

TechEd 2009: Day 3

Yet more tech-fuelled sessions today: App-V, Desktop Optimisation, previews of the next version of Configuration Manager, volume licence activation for Win7 and Svr 2008R2, IE8  and then wrapped up in a couple of hands-on labs (Config Manager client health reporting and building troubleshooting packages for Win7)

Another highlight today is that my tally of freebies has gone up.  I was beginning to get a bit worried that the recession was really going to have an impact but no such fears!  Items of crap memorabilia from TechEd include pens, t-shirts, a magic 8-ball on a key-ring, small cuddly toy, travel adapter plug, drinks bottles, stickers, a SQL 2008 shopping bag, a System Center mini toolkit, and a temporary tattoo (!).  Credit crunch?  What credit crunch….

This evening I took the opportunity to see at least a few of the sites that Berlin has to offer including the Brandenburg Gate, Reichstag and the very impressive Sony Centre.

Tuesday, 10 November 2009

TechEd 2009: Day 2

Definitely been able to get my geek on today: sessions on VHDs in Win7, Microsoft Deployment Toolkit 2010, Windows Crash Dump Analysis and then ending ending with another Mark Minasi presentation entitled ‘Cracking Open Kerberos’.  I was even able to squeeze in a Hands-On Lab on App-V and also get to talk to some Microsoft staff in the Technology Learning Centre about some App-V issues and Forefront Client Security, with the only sacrifice being that I ended up not having anytime to grab any lunch.

The session on Crash Dump Analysis was really good.  Served as a refresher in some areas for me but I learnt a whole load of new stuff like how to debug a hung but (but not crashed) system.  Coolest thing of all was how to turn a BSOD into a RSOD.  This is the kind of stuff that I really enjoy, trouble is Windows is getting too reliable these days…

With the last session finishing at 18:15 it was time for the TechEd Welcome Reception in the exhibitors hall which means free beer & food, magicians(!) and the chance to blag some freebies…

Monday, 9 November 2009

TechEd 2009: Day 1

So how was the first day of TechEd 2009?  First two sessions of the day were really good, one on some tech issues with WDS and the second on using hacker-like techniques to become a better sysadmin.  That took us up to lunch which was okay (mmm, veal) given the scale of the catering operation.  Apparently over 31000 meals will be served over the course of the event!.  After a lunch was a session on desktop virtualisation which wasn’t anywhere near as deep-dive tech as it was advertised as, and then the keynote.  Biggest announcement was the launch today of Exchange 2010 which looks pretty good from both for both infrastructure and an end-user perspective, but other than that it was a big old marketing presentation that didn’t really tell me anything new.  Day ended with a hand-on lab on Advanced PowerShell just to relax and wind down….

Anyway, today is the 20th anniversary of the Berlin wall coming down but it looks like the it was going to be mad crowded plus its raining so I’ll watch on the German news channel in my hotel.

Oh, one other item of note: Mark Minasi has shaved his beard off!

TechEd 2009: Day -1

So here I am in Berlin ready for the start of the week proper tomorrow morning.  Apart from the early start flight was okay (for a no frills, budget airline anyway.  Wipe-clean vinyl seat coverings and £3 for a bottle of water probably mean that they save/make money elsewhere.  That said it left on time, arrived earlier than scheduled and my case made it to Schonfeld Airport so I should really can’t complain.  Myself & my colleague caught the train to the hotel and it was as expected: clean and on-time, downside was the amount of maintenance work which meant it took six changes instead of the expected two but it meant that I got to see a bit more of Berlin than I would have normally.  After checking-in it was yet another short train ride to the Messe Berlin, the venue for TechEd, to register.  It is a massive venue, a bit like a having the NEC in a city centre but looks like the event organisation this year is as good as ever.  Got the obligatory conference bag (just as well as the one from last year wouldn’t have lasted much longer) and inside was a copy of Windows 7 Ultimate!

Having gone through the list of sessions it is definitely going to be a case of not having enough time to do everything I want to so I’m in for a pretty intense week trying to cram in as much as possible.  Will keep you posted…

Friday, 18 September 2009

Inventorying Environmental Variables with SCCM

I needed to get Configuration Manager to collect information about environmental variables on client PCs (as we add a unique system variable to identify the version of the image that has been applied).  Out of the box Configuration Manager doesn’t do this, but after posting the question on one of the Configuration Manager TechNet forums I was directed to this.  Everything I needed was there (so I won’t bother repeating it here, but it served as a reminder on something that I had simply forgotten!), so big thanks to Sherry Kissinger and myITforum.com.

He ain’t a ‘Heavy’…

Have been quiet on the blogging front of late for a number of reasons.  Work has been particularly manic, as being a HE institution students are now returning coupled with the fact that quite a chunk of my time has had to dedicated to preparing and conducting technical interviews as part of my departments restructuring exercise.  In some ways it has been useful, in others not so much as it has highlighted some ‘areas of concern’.  What’s that you say? Skills gap….?

The other distraction of late has been Team Fortress 2.  I used to play TF back in the day but then moved over to the dark (console) side.  Well now I’m back and as a result have many many hours unaccounted for.  Happy days….!

Wednesday, 26 August 2009

Presenting…Config Manager!

This morning I had to do a 50 minute presentation to nearly forty colleagues on Configuration Manager, the idea being to provide an overview of the product and then follow it with how it has been implemented here.  Biggest problem was that the audience was so mixed (the Director of IT along with his senior management colleagues (no pressure there then!), 2nd & 3rd line tech support staff, admin staff and a few others) which meant that I had to make sure that the level of any technical content was pitched at the right level ie: lowest common denominator.  And to add to that, it was also filmed so that it could be made available on our intranet for those colleagues unable to attend. Despite not having done as much prep as I’d have liked the presentation ran to time, the live demos worked without a hitch, and there were a number of questions at the end (which meant that the audience hadn’t fallen asleep).

Next I’ll be doing a session on PowerShell, the best thing about that being that it will be less PowerPoint (other presentation production applications are available…) and more command-line.  I’m really looking forward to doing that one as there are loads of really cool things to cover although I fear that I may have my work cut out keeping senior management interested…

Tuesday, 11 August 2009

Ich gehe nach Berlin…!

Yay, finally got approval for myself and a colleague to attend TechEd Europe 2009 in Berlin this November!  Anyone who has previously attended TechEd will know that without a doubt it is the best deep-dive tech training you can get on MS stuff.  Plus you get to here people like Mark Russinovich speak, now your not going to get that at your local training provider are you?  Downside is that Steve Riley won’t be speaking as he’s now working for Amazon Web Services.  I know that in the current financial climate I’m really lucky to be able to go, and given the current atmosphere at work it may cause some raised eyebrows, but one of the benefits out of attending last year meant that I was able to get Configuration Manager implemented in less than two weeks which I guess helped justify to those signing off the budget the benefits of attending.

A five day MS geek-fest, can’t wait!

Tuesday, 14 July 2009

Management pies…

I’m feeling pretty chuffed at the moment as the Configuration Manager implementation at work has gone really well. This is without doubt due to (warning: shameless self-promotion imminent) my technical leadership of a really good team of colleagues, and to be honest it wouldn’t have gone anywhere near as well as it did without them.

Okay, so we now have a system that can provide more data than you could ever need, and on the off-chance that there isn’t a report already present that you may need, you just knock one up, or maybe get your geek on with SQL Management Studio. Anyway, as expected there is a requirement to make some information available to members of senior management to aid with ‘planning & strategy’. As such, you need to make these sort of reports as FP as possible, ie: pictures (graphs). Now we have built our Config Manager infrastructure on Windows Server 2008 x64 (yes, I know that Config Manager is 32-bit only…) and everything works fine except after installing the Office Web Components on the server running as the Reporting Point I still wasn’t getting any graphs displayed on any reports, just the useful message:

This report has a chart, but the Microsoft Office Web Components required to view charts are not installed on the Reporting Point. Please contact your administrator.

Bit of digging and the solution was found here. You need to configure IIS to run 32-bit apps on x64. Ran the script, restarted IIS and I can now make easily digestible pie-charts available for consumption.

Update:

Would appear that since making the above change despite being able to view graphs through the SCCM Report Viewer, there are now errors being generated (one an hour) against the server acting as the reporting point, although on the face of it everything else seems to be working fine. Reverting the setting stops the errors so some further investigation is required, or I could get some wax crayons and draw the graphs by hand for them....

 

Update #2:

Sorted!  Found a box running 32-bit server 2003, added it as a new site system with just the Reporting Point role, installed Office Web components and as a certain potty-mouthed chef might say..‘Done!’.

It also now means that I am now free to revel in whatever adrenaline-fuelled activity that HE IT may throw at me this week….

Friday, 26 June 2009

So you work in IT…?

Once again the unwritten rule of ‘you work in IT therefore you are expected to know everything about any device that is powered by elastic-trickery and has some sort of user-input (normally buttons)’ came into play today.  Was it a case of “how would I list all installed MS updates on my PC using PowerShell?” or something similar?  Errr, no.  It was “how do I create contact groups on my Nokia mobile?”  Guess it goes with the territory of my chosen career path…

Anyway, today wasn’t all bad.  My copy of Windows Internals 5th Edition was waiting at home for me.

Oh, and if you did want to list the installed MS updates using PS…

image

Wednesday, 24 June 2009

Check out the (MS) research…

As you may have noticed, there tends to be a theme throughout my posts where I highlight things to do to help fill those moments of work boredom with some geek/tech-related stuff that could, if caught by your line manager, probably just about be classed as legitimate work-related research.  You’ll be glad to know that the same pattern will continue…

Today’s recommended time-filler is a trip to Microsoft Research Labs.  Now I’m guessing that there are some people out there who have the opinion that whenever Microsoft need some new tech/product they simply go out, find someone who is already doing it, buy the company, rebrand the product.  The number of projects being carried out at the various MS research centres and labs across the globe does a pretty good job of highlighting how much R&D they’re actually doing.  They’ve also got some pretty cool stuff to download.  Some of it could be classed as work-related such as the Microsoft Research TCP Analyzer, others less so such as Songsmith but worth having a play with for the entertainment value alone.  Auto Collage is another that falls into the not-completely-work-related category but is also worth a look.

Monday, 22 June 2009

Big brains…

As I’ve posted previously, Channel 9 is a good place to go if you want to geek-out for a while.  One of the most treasured books on my desk at work is Windows Internals 4th Edition, nearly 1000 pages of deep-dive into the inner workings of Windows OS’s.  To tie in with the long-awaiting Windows Internals 5th Edition, which now includes Vista & Server 2008, Channel 9 were able to get both Mark Russinovich & David Solomon together for an interview.  So for 15 minutes in the presence of two of the biggest Windows brains (David teaches MS’s own staff about Windows!) check out the interview here.

Update: My copy is ordered!

Update #2: Yay! My copy has arrived!

Wednesday, 10 June 2009

A blog of blogs…

One of the blogs that I subscribe to is the Official Microsoft Team Blog, which is a list of the official MS Team blogs.  There are a lot of blogs that I didn’t know existed, and a few that have subsequently turned out to hold the occasional nugget of tech goodness.  You can find BlogMS here.

Tuesday, 9 June 2009

Defrag a disk with PS…

At various points during the Config Manager course I was on last week there were some inevitable lulls to proceedings whilst waiting for the virtual machines to do their thing.  To fill the time I revisited the Win32 classes documentation on MSDN (okay, surely I could have found something more interesting to browse, but once a geek always a geek…).  There I came across a class that I hadn’t spotted before: Win32_DefragAnalysis.  Straight away I started to think “hmm, can I check a disk and then defrag it if required using a PS script…?”.  Granted, any normal person would have thought “Hmmm, boring.  Maybe I’ll just start an InPrivate browsing session and find something more interesting…”, but I digress.  It turns out that it’s quite easy, use Win32_Volume to identify what drive you want to analyse/defrag then use that to hook into Win32_DefragAnalysis/Win32_Defrag…

image

Win32_DefragAnalysis & Win32_Defrag are only available on Server 2003 and higher.  I tested this on Win7 and it ran fine, but it needs to be run elevated.

Will I ever need to use a script to defrag a drive?  Probably not, but it’s nice knowing that I could if I wanted to…

Saturday, 6 June 2009

PS on Win7 RC: The same but different…

It turns out that a few changes have been made between the CTP3/Win7 Beta version of PowerShell and the version that comes with Win7 RC.  Microsoft MVP Oishin Grehan has posted a good summary of the differences here.

Friday, 5 June 2009

Up North…

I’ve spent the last 5 days attending a Configuration Manager course with three colleagues as I’ve got to get it implemented at work, with the project kick-off starting next week.  The course was pretty good with the training provider being ICT Focus who work out of InfoLab21 at Lancaster University, and if you’ve ever travelled up the M6 in the vicinity of junction 33 you’ll have seen the distinct looking orange & green building.  As a training provider/venue it was really good, I’ve certainly never been on a course where the delegate PC’s were Dell Optiplex 755 Core 2 Quad machines with 8GB RAM.  That said, the course was run on pre-built virtual machines which maybe should have been tweaked to make the most of the host PC (honestly, how well do you think a virtual instance of Server 2003 running as a DC with SQL 2005 and Config Manager on top is going to run when you only allocate 1 CPU and 620MB RAM?  Like a drunk 3-legged dog, that’s how well…).  VMs aside the training was pretty good, the trainer knew his stuff, and the lunches were good.

Our accommodation was a hotel in the centre of Lancaster and unlike the training venue it wasn’t so good.  There was a plaque on the wall outside…

Photo424

…hmmm, I’m just surprised that he came back for a second visit!  It wasn’t all bad as it meant that instead of eating in the hotel we checked out some of the alternatives in Lancaster which meant that we got to eat at The Water Witch a couple of times where the food was fantastic and the beer wasn’t bad either.

Wednesday, 13 May 2009

All quiet on the Win 7 front…

I’ve been using Windows 7 RC as my main machine at work for two weeks now and my lack of posts about it, other than some of the cool BITS improvements,  has simply been due to the fact the it’s pretty much been a seamless transition, it even happily dealt with the dodgy MSI for our help desk application (which was built quite some time ago on a W2K PC).  The only issue that cropped up a few times was the lack of a Win 7 version of the Remote Server Administration Tools.  I tried to install the Vista version but no joy, until today when I found out, via my TechNet Flash feed that the RSAT RC for Win 7 was now available.

Downloaded, installed, working.  Not much more to say really…

Friday, 8 May 2009

Things must be bad…

You kind of get an idea as to how bad the current economic climate is when Microsoft announce further job cuts.  While I was checking my RSS feeds this morning this was really made apparent with both Steve Riley and Eileen Brown announcing on their blogs that they were both victims of this second wave of redundancies.  On more than one occasion I’ve been lucky enough to hear them present at various MS events, including TechEd, on security and UC, and I’m pretty sure that neither of them will be out of work for very long.  I know that they won’t have been the only people that MS will have made redundant, but if they' need to lay off people like Steve and Eileen then things must be grim.

Thursday, 7 May 2009

(Web) surfing

Spent ages in a meeting of a non-tech nature this morning (that’ll be four hours I’ll never get back) and finally got back to my desk, and more importantly, my lunch. While eating and perusing the BBC website I found a link to the below…

Not tech-related at all but pretty cool though.

Wednesday, 6 May 2009

BITS on Win 7

A while back I posted about the ability to leverage BITS with PS v2, some of the really cool things being that it’s a network friendly way of transferring large amounts of data and that once the transfers are running they can survive connectivity-loss or even a reboot.  I started to take a look at this again today, this time using PS on Win7, but when I ran the script that had previously worked it bombed out.  Before you can do anything BITS-related in PS you need to load the required module, so I did the same again hoping to identify the error…

image

And there was the answer, turns out that with the version of PS that ships with Win7 the module name changed, so running…

get-module –ListAvailable

…showed that the module name was now BitsTransfer.

image

Yay!  So after importing the correct module name I was back in business.

image

Note that the cmdlet names have changed as well.

Vista SP2

Vista SP2 RTM was made available on TechNet last week so to add insult to injury, I’ve taken my trusty M400 out of the cupboard to use it for a test install (not only am I neglecting it for something shinier with a new OS, I’m also prepared to kick it when it’s down and throw a new Service Pack at it).

Anyway, kicked off the install and..

clip_image002

Well, it didn’t quite take an hour but it wasn’t far off and so far so good, as in it hasn’t BSOD’d on me.  Having reviewed the Notable Changes doc I’m not sure I’ll really notice anything different: already had Search 4.0 installed and my M400 didn’t ship with a Blu-Ray burner….

Tuesday, 5 May 2009

Meeting prep…

I’m trying to use Windows 7 as much as possible (I’ve installed it on a Toshiba A600 and it seems to be running pretty well) and that means leaving my trusty but ageing M400 running Vista in the cupboard. My scripting tool of choice is Primal Script but it’s still on my M400 so I’ve been using the PowerShell ISE that ships with Windows 7. I had to attend what I knew would be a boring meeting this morning so in preparation I decided to print some PS code I’d been working to take with me (and hopefully not get caught doing so by the other attendees!). It was at that point that I discovered that the ISE doesn’t have the ability to print! I’ve never noticed before as I’ve done pretty much everything through Primal Script, although given that it still only (I think) the CTP I shouldn’t really complain if it’s missing a couple of features, although printing does seem pretty fundamental. Just meant that I had to actually pay attention during the meeting…

Friday, 1 May 2009

Quadrillions of bytes…

With PowerShell v1 came a set of administrative constants that made it easier to easily display storage values in MB, GB etc.  PS v2 has gone even more enterprise-class as shown below:

image

Yep, you can easily report disk space in terabytes and petabytes.  So this bit of code…

image

 

…shows how much space I’ve got free on my C: drive in petabytes.  Even with a 134GB of free space on the notebook I did this on I had to format the output to 5 decimal places to show a readable value!

Thursday, 30 April 2009

Windows 7, getting RC...

The release candidate of Windows 7 was released to TechNet & MSDN subscribers today (everyone else will have to wait until 5th May) so I downloaded it and again tried it on my Toshiba NB110 netbook . Just as I did previously with the beta version I installed from USB and it went even smoother than before with no problems reported in Device Manager.
Am going to try and use this release of Win7 a bit more than I did the beta version and will report back anything noteworthy.

Wednesday, 29 April 2009

Passed…

Finally got my ITIL v3 Foundation result through the post.  Even before opening it I had a feeling I’d passed as it was an A4-sized envelope marked ‘Do Not Bend’ which sort of indicated that there was a certificate inside.  Lo and behold there was indeed a certificate inside as well as another sheet of paper with my actual score.  I ended up getting 90%, which equates to getting 36 out of the 40 questions correct (and saying 90% sounds better!).  A little disappointed that I didn’t get 100% but given that the pass-mark is 60% I don’t suppose I did too badly.   My colleague from the Service Desk also passed which means that everyone who’s taken the exam at work so far has passed first time (although everyone else has done the slightly easier v2 exam).  Guess it’s just increasing the pressure for anyone else who’s going to take it…

Also, I’m going to be trying out Live Writer for updating my blog.  Seems pretty good so far, and who knows it might even make my postings more interesting….

Thursday, 23 April 2009

The Winds of Change...

...aren't so much breezing through at work this week, it's more like a shamal. As I posted previously we're starting to implement ITIL v2 here, and earlier this week the official proposals were announced...

Wednesday, 22 April 2009

PowerShell in 15 minutes

If you've got 15 minutes to spare and want an overview of PS v2, brought to you by Jeffrey Snover, then check this out. This was a presentation he did at Lang.NET 2009, and if you can keep up it's well worth a look. You want end up knowing PS as a result but you'll have a pretty good idea about how powerful it is.

Monday, 13 April 2009

Preventing boredom with numbers (and PowerShell) #2

Towards the end of last week I started to look at how I could get a PowerShell script to generate a list a list of Perfect Numbers. It's not that I wanted to know what they are (that's what Google is there for), I just wanted to see if I could code it up in PS. Given the nature of Perfect Numbers, the first thing is to identify those numbers that are proper positive divisors of the starting number eg: 6 is the first Perfect Number as the sum of the proper positive divisors (1, 2, & 3) equal the starting number.
The basic premise was to code the division (easy), then check to see if the result was a whole number, cast all the results into an array and then see if the sum of the numbers in the array equalled the starting number, then start the process again incrementing the starting number by one.
First hiccup was to how to check whether the result of the division was a whole number. A post to the Scripting Guys Forum on TechNet on Saturday night prompted a number of suggestions as to how I could do this (thanks to all who replied!). Being lazy I've gone for the (hopefully!) least typing option and that is to perform a check on the result of the division with something like this:
$result = 6/2
if ($result -is [int]){write-host "It's a whole number"}
That's as far as I've got in what is probably the next installment of my series of 'Preventing boredom with numbers (and PowerShell)' postings, but fear not dear avid reader, I will keep you updated as to how my latest sleep-inducing PS project is progressing...

Friday, 10 April 2009

What's the temperature Mr Cricket...?

I was listening to the latest George Lamb podcast while I was running earlier and heard something that really needed an independent web-search to validate what I'd heard, namely that by counting the number of times a cricket chirps in 14 seconds and then adding 40 you'll know the current temperature in Fahrenheit. Sounded a bit dubious, but I subsequently found this on the Library of Congress website. The article actually says it's 15 seconds then add 37, but given that it's a pretty cool fact I'm not going to argue. There's some other interesting stuff to be found there, and I now know that I won't be able to have a zebra for a pet as they can't be domesticated. Oh well, back to the original plan of getting a monkey butler....

Thursday, 9 April 2009

ITIL'd out of my mind...

I've just finished 3 days of ITIL training with the added bonus of having to sit the v3 Foundation exam this afternoon. Just have to wait for anything up to three weeks for the result to drop through my letterbox. We're starting to implement v2 at work, but even having only done the Foundation course, the amount of work that's going to be required is massive. That said, the potential gains in efficiency, effectiveness, and (warning, I'm about to slip into ITIL-mode) the improvement in our ability to deliver the right services to our users is going to be well worth it.
The best thing about handing my paper to the invigilator at the end of the exam? It signalled the start of just over a week off work...

Friday, 27 March 2009

No excuse now...

After a particularly uninspiring and pretty awful week at work, there was one nugget of tech goodness that I uncovered this afternoon: Powershell is now available for deployment via WSUS! I'd already built a deployment script using VB that did the pre-req checks etc but I'd delayed using it in the hope that it would appear on my WSUS boxes. It did earlier this week (it's classed under Feature Packs), so early next week I plan to do a couple of test deployments and then release it to PCs in my department. The really good thing is that I can now start putting some of my dev scripts (each time I put a new VBS script into production I produce the equivalent PowerShell script) into use live environment.
If PowerShell appearing as an update on my WSUS boxes was the highlight, you kind of appreciate how bad the last working week was....

Tuesday, 17 March 2009

Well deserved

Found out today that Jeffrey Snover has been given the accolade within Microsoft of Distinguished Engineer, which according to the front page is "an acknowledgement of the key role being played by a technical contributor, whose high level of performance, technical vision, expertise and world-class leadership is instrumental in developing and driving products and standards for Microsoft and the technology industry into the future." It just goes to prove how importantly MS view PowerShell. There are only about 40 DEs in MS so it's some achievement.
Also linked on the same page was the list of Microsoft Technical Fellows. The names of Mark Russinovich and David Cutler feature here and should be well known to IT Pros. Some of the other names though may not be so well known, for example I didn't know that Chuck Thacker worked on the first Tablet PC.
What is really enlightening is that when you read about what the DEs and TFs know and do, it proves that when they present at events like TechEd they are only barely scratching the surface of a given subject with the audience.

Monday, 16 March 2009

Monkey surfing

I have been sounded out about doing something for Learning at Work Day, specifically something with Powershell, maybe just a couple of useful short one-liners. Having given it some thought, I did realise that an easier introduction, assuming that the audience are not completely petrified of a any sort of CLI, would be to demo that anything you currently do from command prompt you can also done from a Powershell prompt.
But then the realisation hit me that if someone checks my blog they will learn of what is in-store and then not bother showing up when I run my session! The reason for my fear was based on the Infinite Monkey Theorem: given the amount of non-work related surfing done here would it be inevitable that staff may eventually come across my not-so-publicised blog? But my fears were then allayed, to stumble upon this would mean that they would have to tear themselves away from Facebook first....

Friday, 6 March 2009

Geek-out with Channel 9

One of my RSS feeds is to Channel 9, and early December '08 I came across a video of a conversation between Erik Meijer and Jeffrey Snover, the creator and partner architect of PowerShell. I've attended a few presentations by Jeffrey at TechEd over the last couple years and his passion for all things PowerShell is both obvious and infectious, but this article goes 'under the hood' and covers areas such as how it's designed, the thinking behind it's architecture and how some of the new features in v2, such as transactions, actually work.
It's not going to teach you how to use PowerShell, but if you're already using it and want to geek-out for about an hour I can thoroughly recommend it.
You can find the the article here.

Tuesday, 3 March 2009

BITS and pieces...

Over the last couple of days I've been playing with the new cmdlets that ship with PowerShell v2 CTP3 that let you hook into BITS. If you need to move large volumes of data around, don't want to melt your network gear, and want to be able to cater for users who may reboot on a whim and then want your file transfer that was 98% complete pick up where it left off then BITS is for you. Sysadmins have previously been able to do this using bitsadmin from the command-line, but now you can hook into BITS through PowerShell. So far all I've done is knock up a pretty simple script to transfer a 1GB file from a fileshare, display an updated '% complete' value every few seconds, then tidy up after the successful transfer. It's still amusing to pull the network while the script is running and watch it just sit there patiently, not throwing a strop and falling into a heap, and then carrying on when connectivity is restored.
Here's the original article on the Windows PowerShell blog, which explains it pretty well, and PowerShell v2 CTP3 can be downloaded here.

Wednesday, 25 February 2009

Fries with that...?

Had to do a presentation to a number of colleagues on the features that Microsoft have introduced with Internet Explorer 8, highlighting those that increase productivity (do more, more easily) and the improvements to security (do more, and do it more safely). I've been using it since beta 1 and really like it, finding it a pain when I'm forced to used either IE7 or IE6 on other machines. And when asked am very enthusiastic about it with people probably wishing that they'd never asked!
That said, after today I think I'll keep my enthusiasm to myself and not waste it doing presentations trying to instill it into others. In fact, working at the golden arches feels like it would be so much more rewarding at the moment...
UPDATE: Hmm, maybe given what I read here I shouldn't be indicating that my work was in any way unrewarding. Maybe as I didn't say 'boring' I'll be okay. Not that I would ever say my job is boring of course...

Tuesday, 24 February 2009

Windows 7 on a netbook?

After a few delays the Toshiba NB100 netbook that was ordered a while back arrived at work today. The delays were not due to any failing of our own internal ordering processes at work, merely that the not-so-conscientious dim-witted loon of a courier felt that when delivering to a University establishment he could simply leave the package with the first person he found in reception providing that they would offer a signature in return. Needless to say, the first NB100 that was delivered never made it as far as my desk, but we now probably have a student who is the proud owner of a new netbook....
Anyway, I recently came across this on Technet Edge recently so thought that I'd give installing Windows 7 with a USB stick a go. About 25 minutes later the install had finished, all devices detected, and after installing some AV software it was done. Okay,so it's not the most rapid machine ever (base score of 2.0 due to the hard-disk, Mr Atom scored slightly better at 2.2), but it boots up in about 30 seconds and the performance is more than adequate, and even the Aero interface works! I'll try a few more things over the next few days (install Office 2007, join it to the domain) and then palm it off onto a colleagues for testing ie: once the novelty has worn off. If I get any feedback that is relevant / interesting / printable I'll post it, just don't hold your breath...

Friday, 20 February 2009

Unplugged

I've just got back from spending 5 days in Newquay, Cornwall stopping in one of the Headland Cottages, with the closest I got to any sort of technology was checking the weather forecast on my phone (when I could get a 3G signal). And because the weather was so good for this time of year pretty much each day ended with a view like this...

That said the effects of going tech-free for a few days are beginning to kick-in: despite finding it very easy to summon up enough willpower not to check my work email, resisting the call of the Wii (specifically House of the Dead: Overkill) is getting tough....

Tuesday, 10 February 2009

Preventing boredom with numbers (and Powershell)..part 2

I spent a fair proportion of today stuck in a meeting (it was one of my favourite kind, lots of flip chart paper & post-it notes, and no coffee....) Anyway, there were a couple of occasions where my concentration lapsed, in fact at one point I had to 'fess up to having not been paying attention as I was asked a question and it was obvious that my thoughts were elsewhere and I had almost no idea what the topic of discussion was. It was during one of these particularly post-it note intensive sessions that for seemingly no reason I wondered how easy it would be to get the Powershell one-liner that listed a Fibonacci sequence of number to display the binary or hex equivalents. The asnwer, it turns out, is 'very easy' as you can simply leverage the power of the .NET framework from within Powershell eg: to convert 734 to binary (base2) you'd simply run:
[Convert]::ToString(734, 2)

or to hex:
[Convert]::ToString(734, 16)

Adding the convert functionality to my one-liner stopped it being just that (a one-liner!) and it 's now:
$1=0;$2=1;$3=$1+$2
do{
$3hex=[convert]::ToString($3, 16)
$3bin=[convert]::ToString($3, 2)
$output="$3`t`t$3hex`t`t$3bin"
$output
$1=$2;$2=$3;$3=$1+$2}
while ($3 -lt 10000000)

So thanks to the power of excessive post-it note usage I've tried something new with Powershell today...

Monday, 9 February 2009

Querying event logs with Powershell

Last week I had the opportunity to talk through a Powershell script with a couple of members of my team. The script itself was one I had written to trawl through all of the event logs on my main Vista notebook and to just report back any entries flagged as Errors, with a parameter of n where n is the number of days that the script was to go back through. Once I'd explained that the first 30 lines were comments and the built-in help it was apparent that this was actually the perfect way to demonstrate what Powershell is capable of. Right at the heart of the script is nothing more than a simple cmdlet that demonstrated the verb-noun principle ie: what do you want to do? - what do you want to do it to?
So I started off by simply showing what happens when you run get-eventlog from the Powershell prompt:
get-eventlog Application

then restricting it to just errors:

get-eventlog Application where {$_.EntryType -eq "Error"}

and then to limit the numbers of days to check back through (in this case 3 days):
$date = Get-Date
$recent= $date.AddDays(-3)
Get-EventLog Applicationwhere {($_.TimeWritten -ge $recent) `
-AND ($_.EntryType -eq "Error")}

And so the rest of the session went on, also going through how the script built an array of the available logs and then iterated through each one in turn. End result was that they now had PS script that could quickly check a machines event logs for errors (GUIs are so overrated), but more importantly they had a useful and relevant intro to Powershell (as well as a good understanding of how the script worked).
And the most important cmdlet that I told them about (almost a dozen times)?

get-help

Monday, 2 February 2009

Place your bets now...

Today is National Sickie Day apparently and given that we in the UK have got a bit of snow at the moment, Mother Nature has made it even easier for the work-shy to come up with an excuse for not showing up at work. Wonder how may no-shows we'll have here?
Update: Looks like most people are here today but given that a few snowflakes have fallen there are various murmurs like "they should let us leave early because of the snow...". So does that mean IT departments in properly snow-ridden places like Alaska only ever do 4 hours a day?!?! Rhetorical question....

Friday, 30 January 2009

Preventing boredom with numbers (and Powershell)

During one of those lapses in motivation this afternoon at work I had a go at putting together a Powershell script to list a sequence of Fibonacci numbers (in true geek style, did I do it because I needed to? No. Did I do it because I wanted to see if I could? Yes). Disappointingly I got it done pretty swiftly which meant that I had to get back to doing some real work, but being able to make it a one-liner was quite satisfying:

$1=0;$2=1;$3=$1+$2;do{$3;$1=$2;$2=$3;$3=$1+$2} while ($3 -lt 10000000)

The code above uses 0 & 1 as the starting numbers (just change the values assigned to $1 and $2 to use others) and keeps going until the result is greater than 10000000. If I get bored next week (ha, ha! as if....) I might use the speech capability I mentioned here to get the script to read out the numbers for me, interspersed with profanities....

Thursday, 22 January 2009

Clock-a-doodle-do!

Added a clock to the sidebar from ClockLink. Useful if you find that it's too much effort to look at the watch on your wrist....

Tuesday, 20 January 2009

Windows7

Like countless others I've downloaded the beta of Windows 7. Being a TechNet subscriber I was able to download copy before the general public, and more importantly before Microsoft's infrastructure melted and required an upgrade. If you haven't had a chance to take a look at the new OS and want a quick tour of some of the new features, Jamie Burgess of Microsoft has created a video manual covering the new features like this one on the new task tray:
You can find the rest of them here on Jamie's blog.

Thursday, 15 January 2009

Dirty code

Everyday I like to try and learn something new. Today, courtesy of The Scripting Guys it's been to add speech output to VBS and Powershell scripts. Other than giving some of my scripts a potty-mouth not really much use. Very funny though, well for at least five minutes anyway...

Wednesday, 14 January 2009

Do more (or the same) with less...

One of the best the best things about Powershell (and there are many) is that it allows lazy IT Pro’s like myself to be just that: lazy, or in my case even lazier than normal. Someone on my team at work today asked me how to query an environment variable using VBS. Being as inherently lazy as I am my first answer was “I can tell you how to do it in Powershell” because I knew it was a one-liner, whereas VBS would require a bit more typing.
Say you needed to get the value associated with the environment variable PROCESSOR_IDENTIFIER. To achieve this in VBS you’d do something like…

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colEnvVar = objWMIService.ExecQuery _
("Select * from Win32_Environment where Name = 'PROCESSOR_IDENTIFIER'")

For Each objEnvVar in colEnvVar
wscript.Echo objEnvVar.Name & ": " & objEnvVar.VariableValue
Next

Granted it’s not the longest piece of code ever typed, but why wear your fingers out any quicker than you need to. To get the same information using Powershell all you need is…

get-childitem env:PROCESSOR_IDENTIFIER


get-childitem is usedto retrieve the items from the specified location which in this case is env: which is the Powershell environment provider, and PROCESSOR_IDENTIFIER specifies the relevant variable to report on. If you want to report on all variables, and type even less, try…

gci env:*


gci is the alias for get-childitem and the wildcard means all variables will be reported on.
So if you want to be able to start putting less effort into things, try Powershell.

Monday, 12 January 2009

The answer is out there...

I've been playing with Powershell for some time now, pretty much since it was still codenamed 'Monad' (I say 'playing' as the only PS scripts that I've put into production have been at home as all my scripting at work is still either VBscript of old-school .cmd). If you've done anything with Powershell you'll know how easy it is to get stuff done in considerably less code than would normally be required with VBS. At one of the sessions I attended at TechEd last year, Jeffrey Snover the architect behind Powershell said he'd seen examples of massive code reduction, the best behind 481 lines of VBS down to 1 line of Powershell. Hmm, so far rewriting some of my scripts from VBS to Powershell have only achieved about 50% code reduction but given my coding skills (!) that's pretty impressive. Still, it gives me a target to work to I suppose...

Anyway, I've been working on a PS script part of which was the need to compare two pretty big file listings and I'd reached a point where I was going to have to export the output and use some other method of comparing to identify the differences...until I checked out my RSS feeds this morning and there was my answer: compare-object. Trust me, at this point I probably felt as foolish as the acquaintance who once decided to swap carriages on the Alton Towers monorail at the last minute only to be left standing on the platform as I amongst others mocked him from the quickly departing train. Anyway...

$compare1 = (gci c:\path1 -recurse where {!$_.PsIsContainer})
$compare2 = (gci c:\path2 -recurse where {!$_.PsIsContainer})
compare-object $compare1 $ompare2


...got the desired result, so todays blog of the day (other than this one ha, ha!) is Dreaming In Powershell.