Saturday, 20 December 2008

Powershellers on Twitter

So I was pretty sceptical for a long while about things like Twitter and Facebook, but I finally gave in mostly thanks to my buddy Alan Renouf and to be honest its been brilliant. Its such a useful way to quickly find information and keep up to date with a particular topic, obviously in my case Powershell.

Whilst at Teched it was a great tool to keep up with things which were going on in sessions or what people where up to. I also used it during a Powershell Q&A with Jeffrey Snover to invite fellow Twitterers to give me some questions for him.

At the Get-Scripting podcast its a really useful tool for us to be able to put out info about the show, particularly when we release a new epsiode and conversley really handy to keep up to date with shows like the Powerscripting Podcast and Mind of Root.

Steven Murawski from the Mind of Root podcast has helpfully posted a list of Powershell people on Twitter who you can follow.

Best news of all Jeffrey Snover has just started posting on Twitter! Now that is definitely a good person to follow for Powershell info. ;-) There was lots of chat during the Powerscripting UStream the other night when Jeffrey and Bruce were on the show about how the chat that night was pretty similar to what goes on on Twitter, so I guess that's maybe we he signed up too.

Wednesday, 17 December 2008

PowerScripting Live CTP3 Special - Thursday 18th Dec

This is a must watch PowerScripting Podcast special - the hint is in the title.

Jeffrey Snover and Bruce Payette are the two guests, it should be an awesome show.

Thursday 18th Dec 9pm EST, which translates to 2am UK time. I think I'm going to have to stay up for it!

Thursday, 11 December 2008

Take your own advice Jonathan!

During this last year I've done quite a few presentations about Powershell and quite often as part of the demo I have included PowerGUI since I find it a great way to reel people in who aren't quite yet ready to make a jump the whole way to command line scripting.

One of the topics I usually talk about around this is how I (like most people seem to) initially used the PowerGUI script editor for writing my scripts, but didn't really get what the PowerGUI console was all about. I couldn't quite get my head around why you would want a

GUI console for a command shell to manage a GUI OS or product,

it didn't seem to make much sense to me.

Luckily, we were very fortunate back in May to head over to Quest in the UK with the Powershell User Group for an evening's event. I decided I'd better figure out what the PowerGUI console was for before attending so watched some of the videos on the PowerGUI site to give myself a better idea.

Doing that and seeing Dmitry's presentation in the night made things finally click. You could use it to make custom management consoles for your own use or even better to give to a colleague or share with the community. That's where the idea for the Exchange 2003 PowerPack was born and the Get-Scripting podcast was born almost by accident that night too, but those are stories for another day. :-)

Anyway, back to the presenting. I often show PowerGUI and explain how you can use it to make custom management consoles to give to colleagues.

Recently I have been working out my notice period before heading to a new job and one of the things I have done during that time is create a bunch of scripts for the regular admin tasks I or others carry out (particularly with AD) which I never got round to writing for myself or them and to save whoever took on my role or parts of it a load of hassle.

For instance I finally got around to creating a script for de-provisioning users which should really help to improve the previous process which was in place. It was based on my good friend Jonathan Noble's blog post about setting logon hours for an account rather than disabling it so that the email doesn't bounce. Thanks Jon!

Of course some of these scripts were to be handed over to the helpdesk. Now without being patronising (because we have some very smart people on our helpdesk) it can be quite a jump for a helpdesk person to read through all the documentation I wrote for each script and start running those scripts from the command shell and seeing their results in a blue on black window.

So the cogs started whirring away in the old brain whilst I tried to think of a better way I could deliver these scripts for the helpdesk so they could get up and running with them much quicker and easier without having to read through all the boring documentation first and have a better experience when running them, i.e. don't put them off using the scripts once I'm not there anymore to help them.

Finally it clicked. Why didn't I take my own advice I'd been giving out all year about making management consoles for your colleagues and go and do it myself! So the AD Admin Powerpack was born, I packaged up my scripts into this PowerPack, installed PowerGUI for them and instantly the scripts were far more useable.

No need to read all of my boring documentation beforehand since its pretty obvious what clicking on script nodes such as 'Find Expired AD users' or 'How many users in Active Directory?' will do.

Effective, very simple solutions which save people time, make them more efficient and its makes me feel good to leave something useful like that behind for them to use. Thank you PowerGUI!

Of course the girls on the helpdesk love the train icon so it was an even easier win with them.

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

Monday, 27 October 2008


Welcome to the new home for my blogging. As explained over on the get-scripting podcast blog, I decided to seperate the podcast from my own personal ramblings which will from now on be here, the get-scripting site will be used for podcast stuff only.