Thursday, 27 November 2008

Get-Scripting Podcast Episode 5 - (Dmitry Sotnikov - Quest AD cmdlets and PowerGUI)

We had a lot of fun recording the latest episode of the Get-Scripting podcast on Tuesday night. Its been great having Alan join the show, gives the show a much more conversational feel plus I don't have to come up with all the content. :-)

We had a really interesting interview in this episode with Dmitry Sotnikov talking about the Quest AD cmdlets and PowerGUI - go check it out.

Coming up on the next show in December we have an interview with Ben Pearce from Microsoft. Ben is the guy who recently presented Powershell sessions with Jeffrey Snover at TechEd EMEA, does a lot of Powershell training and is great fun to interview.

Thursday, 20 November 2008

WSUS 3.0 Cleaning out redundant computers

Following on from my last post about WSUS 3.0 and Powershell another thing which bugged me about the WSUS 3.0 GUI is the Cleanup Wizard. This is a really useful tool for keeping your WSUS deployment running efficiently.

It includes the ability to clean out computers which haven't synched with the WSUS server for over 30 days - unfortunately 30 days is the default value which can't be changed in the GUI. Arrgh! I've wanted to run this tool for a long time, but 30 days is way too short and I wanted to be able to specify my own time frame, e.g. 200 days.

Luckily I met Marc Shepard at Teched EMEA and during a Q&A session for WSUS I asked why it wasn't possible to change the 30 day value. This developed into a discussion along the lines that the WSUS team didn't wish to promote removing lots of computers from WSUS - I can't remember exactly why now, I think it was along the lines of preventing lots of computers which were actually still alive synching back into WSUS. (Apologies if this is not the correct reason)

Anyway, even though we had a slight difference of opinion about this (I want to remove old computers so that the monthly patch compliance reports are more accurate), Marc kindly agreed to send me over a Powershell script which would run the cleanup computer part of the wizard under the caveat that this was not their recommended method for maintenance.

So here it is, this version will give you a list of computers who have not synched over the specified number of days:

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null

$days = read-host "Please enter the number of days since Last Sync you wish to query for"
$ts = new-object TimeSpan($days,0,0,0)

$updateServer = "WSUSServername"
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($updateServer,$false)

$computerScope = new-object Microsoft.UpdateServices.Administration.ComputerTargetScope
$computerScope.ToLastSyncTime = [DateTime]::UtcNow.Subtract($ts)
$wsus.GetComputerTargets($computerScope) | sort fulldomainname | ft fulldomainname,lastsynctime

If you wish to remove them then simply change the last line to:

$wsus.GetComputerTargets($computerScope) | foreach-object {$_.Delete();}

I have added both of these scripts and the ApproveMultipleUpdates scripts from the last post to the WSUS PowerGUI Powerpack.

Also keep an eye on the WSUS section of the MS Script Center Marc is hoping to soon publish some more Powershell scripts for managing WSUS.

Sunday, 16 November 2008

Reminder: UK Powershell User Group Thursday 20th Nov

Richard has confirmed details of the next UK Powershell User Group Meeting.

Date: Thursday 20th November
Time: 6.30 - 9.30pm
Location: Memphis Room, Building 3, Microsoft Campus, Thames Valley Park, Reading


Powershell Introduction: Objects and get-member
PowerGUI SQL Server Reporting Services powerpack
Powershell in SQL Server 2008

If you want to attend please send an email to so that you can have a badge waiting for you on arrival.

These are always great events and are well worth attending for anyone with an interest in Powershell (or even SQL this time!). There'll be free pizza too. :-)

Thursday, 13 November 2008

PowerShell Virtual User Group Meeting #7

Tonight there is a meeting of the Powershell Virtual User Group. I haven't been able to make one of these before because of the time difference, but this one seems to have been scheduled a little earlier than before so hoping to make it.

Time: November 13th, 2008 at 12PM EST (noon; New York time)

Some really interesting looking content:

*Nathan Winters (MVP): "Exchange 2007 from PowerShell". Nathan will show how PowerShell can be used with Exchange 2007.
*Joel (Jaykul) Bennett: "PoSh Tools for the Huddled Masses". Joel, a prominent PowerShell developer, is always full of surprises. This should be a "must attend" for everyone.
*Idera (vendor): Idera will demo their PowerShellPlus product. PowerShellPlus is a editor with strong PowerShell support.

Check it out here:

Tuesday, 11 November 2008

WSUS 3.0: Approving Multiple Updates for a Specific Computer with Powershell

One of the best uses I have found for Powershell is for plugging gaps in holes left by GUI admin tools which don't do everything that you want. Prior to Powershell you would typically have had to wait for the next service pack / full release / possibly ever before you had the functionality that you wanted.

I had an example of this recently with the GUI tool for WSUS 3.0. Essentially I was kicking off a project where we were going to target a particular group of machines for patching and the first step was to run a report for specific machines and then approve the updates to what WSUS calls a ComputerTargetGroup.

The problem with this is that although WSUS can provide you with a report which shows which updates are required for a specific machine, there is no way in the GUI that you can approve all of those updates in one go. Since it takes 5 clicks per approval, you only have to get into the 10's of updates before this goes beyond tedious.

I knew there were some sample scripts for WSUS and Powershell on the Script Center so I headed over there and checked out some of the scripts. (This initial investigation led to the creation of the PowerGUI Powerpack for WSUS - fairly basic, but it was great way to learn what sort of things would be available)

So I then spent some time working on a script to approve multiple updates for a specific computer which is shown below. I'd love to say that I put this all togther myself, but really it is another illustration of how helpful people within the Powershell community are. Shay Levi was incredibly helpful putting the initial work of this script together, we got most of the way there, but it got left at the point where I could retrieve as objects the list of updates required for the computer, but couldn't figure out how to approve them for a particular computer group.

Fortunately at Teched I went to a couple of sessions on WSUS 3.0 run by Program Manager Marc Shepard who contributes to the WSUS team blog. I went to see Marc at the 'Ask The Experts' stand inbetween the two sessions he was running. He seemed genuinely pleased to find someone with a particular request for the product (I guess it's free so hey that must be a tricky product to be a Program Manager for ;-) ), took on my unfinished Powershell script and started coding away.

By the time I got to the next session Marc had a working script for me - there is no better recommendation for going to Teched than this!

The script is below. Before running the ApproveMultipleUpdates script you need to establish three things:

  • WSUS Server Name
  • Full DNS name of the computer you wish to query
  • The Computer Group Target ID for the group you wish to make the approval to. You can find this either by using the PowerGUI Powerback or the code below:

$updateServer = "WSUSServername"
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($updateServer,$false)




$updateServer = "WSUSServername"
$machineName = Read-Host "Please enter the full DNS name of the computer you wish to approve updates for"

$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($updateServer,$false)

$updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope

$updateScope.includedInstallationStates = "NotInstalled"

$com = $wsus.GetComputerTargetByName($machineName)

$groupid= Read-Host "Please enter the Computer Group Target ID"

$group = $wsus.GetComputerTargetGroup($groupid)
$action = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::Install

$updates = $com.GetUpdateInstallationInfoPerUpdate($updateScope)
$updates | foreach-object {$uid = $_.UpdateId; $u = $wsus.GetUpdate($uid); $u.Title; $u.Approve($action,$group);}

This is going to save us hours of work - big thanks to the guys who helped me out!

(I think a version of this script should be making its way onto the MS Script Center at some point too)

Monday, 10 November 2008

Video of Teched Powershell Panel Discussion

Just got notification through of the various video available for Powershell Panel Discussion for the Teched Online website:

Download (High res - approx 900MB):

Or if you prefer not to crack your monitor / TV screen

Download (Low res):

Streaming (Low res):

What you get from the video that you might not have picked up on the audio is that we spent most of the time laughing which just goes to show how much fun everyone had doing it!


If you were at Teched Powershell Community Dinner then you will appreciate these two photos - the dare did actually take place!

Saturday, 8 November 2008

TechEd Powershell Panel Discussion

After the TechEd Powershell Panel Discussion we all realised that none of us had arranged for a photo to be taken. :-(

We're still waiting for the video, so thought we could screengrab something of that, but Tobias found that someone else had put a photo they had taken of it on their blog.

From left to right below:

Me, Ben Pearce, Richard Siddaway, Dmitry Sotnikov, James O'Neill, Tobias Weltner, Jeffrey Snover and MoW.

Tech.ed Day 5

All good things must come to an end I guess, so after an amazing week at Teched it was time to attend the last few sessions.

I attended a couple of sessions I have a particular interest in - WSUS 3.0, with Marc Shepard Program Manager. The sessions had promised some Powershell so I had taken along with me a script which I hadn't quite finished off and asked Marc about it afterwards at the Ask the Experts stand.

He seemed genuinely interested and very kindly worked through most of it, then took it away with him and said he would either get it back to me next week or might have time before the next session. So I duely turned up for the next session and was really pleased when Marc presented me and demonstrated the finished script! I will blog about it in detail next week after I have been able to test it back in work, but for me this was a real value for going to Teched, you wouldn't get that kind of help from someone so close to the product at a normal training course.

Marc ran a really great second session, which was a Q&A on WSUS 3.0. He gave some really great answers and took a lot of feedback about the product which you believed he actually would try to do something about.

For the final session of the week I went to a repeat of the Powershell session with Ben and Jeffrey. Due to the fact a lot of people had left the conference by this time, the attendence wasn't massive, but both presenters were so relaxed that it made for a really funny session with lots of jokes. (Possibly more on this in a later post)

Once finished it was off on the provided coaches to the airport and the usual waiting around. Luckily I went with Richard Siddaway, a colleague of his and the aforementioned Ben Pearce so the time went pretty quick.

All in all I had a brilliant time, got loads out of it and now need to work on a plan for how to get there next year!

Friday, 7 November 2008

Tech.ed Day 4

Posting the day after this time, will keep it brief. All you need to know is:

  • Powershell sessions all day with Jeffrey Snover and the exuberant Ben Pearce.
  • Powershell community dinner, 18 attendees. Jeffrey + MoW = mental evening
  • Got back so late it was time for the live stream of the Powerscripting podcast so thought I might as well stay up late and watch it for the first time - great fun.

The amount of sleep I am getting is decreasing by about half an hour each night - it started at about 5 hours on Sunday. This is so much fun though I don't even seem to notice.....

Wednesday, 5 November 2008

Tech.ed Day 3

So a bit more of a relaxed day today after yesterday's panel discussion craziness.

Some great Powershell sessions today.

James O'Neill - how to get effective output from Powershell, in particular OpenXML - I really got challenged to give this a try for creating reports, it looks very useful and not too difficult.

Plus I saw Jeffrey Snover present for the first time - it was awesome, all about stuff coming up in V2 of Powershell - there will be CTP3 of V2 in Dec 08.

Also Dmitry kindly gave me some of his time for an interview for the podcast, so we will get that out in November hopefully.

All finished off by the UK country drinks party, a very chilled evening.

Tech.ed Day 2

So its late, this will be brief, but I had another brilliant day at Tech.ed. The highlight of course was the Powershell Panel Discussion.

I decided to get it out to the get-scripting podcast asap since it was so good, so there is a new episode with just that for content.

Apart from that I went to a couple of interesting Exchange 2007 sessions, an Operations Manager 2007 R2 session and had a nice dinner with some new friends.

This is so much fun........

Tuesday, 4 November 2008

Tech.ed Day 1

The day flew by really. Wandered round Ramblas in the morning, checking out some of Barcelona.

Then the guy I met yesterday (Andy) offered to show me the ropes in getting the Metro to the conference centre which was really helpful.

Quick and easy registration, followed by some lunch and then the first session I went to, Steve Riley. This was amazing, a great presenter and he really made security interesting. (not easy). I think I may have to check out some of his other sessions.

Later on I went to a session on Sysvol in 2008, i.e. you can replace NTFRS, with DFSR. One thing I learnt was you need to get to sessions early because this was totally full and I was the second last person allowed in.

An evening reception and chance to check out vendors and Ask the Experts. I met Mow and Tobias on the Powershell stand which was great. I also thanked the very nice ladies at the Technet Plus stand for the competition I won to get me the place here - they want me to do a video for them on Wednesday so naturally was happy to return the favour.

Just before leaving I was invited out by those great guys at Specops, so an excellent meal was had by all.

Plenty of sessions to get stuck into tomorrow and of course the Powershell panel discussion.

Monday, 3 November 2008

Powershell Panel Discussion at Teched

Tuesday Nov 4th 2 - 3 I will be hosting a Powershell Panel discussion on a stage adjacent to the Tech Talk Fishbowl.

Invited attendees include:

  • Dmitry Sotnikov - Powershell MVP
  • Richard Siddaway - Powershell MVP
  • MoW - Powershell MVP
  • James O'Neill - Microsoft
  • Some guy called Jeffrey

I will be recording the session for the get-scripting podcast, apparently it will also be videoed and available at the Teched Online website.

Visit this stand

If you are at Teched EMEA you must visit the Specops stand, especially if you are interested in Powershell.

They may even give you one of the freebie underpants - possibly the strangest giveaway I have seen.

Sunday, 2 November 2008

Tech.ed Day 0 - (aka geek week as its now known in the Medd house)

So I'm out in Barcelona for my first Tech.ed, really looking forward to it kicking off tomorrow:

Tip #1: Don't lift a chest of drawers up the stairs the day before going, its not good to travel with a back strain. I'm seriously hoping this wears off quickly

Tip #2: Strike up conversations with Tech looking people, so far:

  • At the airport car park I was waiting for a bus with one guy carrying a Tech.ed bag, obviously got chatting to him.
  • I got seated next to Nathan Winters - Exchange MVP on the plane. I knew who he was, but not vice-versa - he does now! (I think)
  • I tagged along with a similarly lost tech looking person at Barcelona airport looking for the bus into the city - he kindly pointed me in the right direction for my hotel after making it to the city and offered to show me how to get to the centre tomorrow via the metro.
  • Met up for the first time this evening with fellow Powershell fan Jon Noble, what a nice chap.

Consequently I have loads of tips and helpful info for getting the most out of this week.

I'll most likely be at all the Powershell sessions (also you will see me at AD and Exchange sessions), please say hello.

Monday I will definitely be at:

IDA01-IS Ok so what happened to SYSVOL in AD 2008? Do I need to care?
Room 133 at 17.45