About Jonathan

Windows Server infrastructure administrator at Newcastle University since 1999. Microsoft MVP for Cloud and Datacenter Management (& previously for PowerShell). Member of the Microsoft Technical Community Council. Co-founder of the NEBytes user group. @jonoble on Twitter.

Learn PowerShell in a series of free Live Meetings

On Monday 12th March, Ed Wilson, the Microsoft Scripting Guy, is starting a week of free Live Meetings to get beginners up to speed with Windows PowerShell. The live sessions are at 10am(Pacific) each day, so that’s 7pm to us, but they’ll also be recorded and available at the TechNet Script Center’s Learn PowerShell page, where you can already find some great content.

The Windows PowerShell for the Busy Admin series covers the following:

Session 1PowerShell SmowerShell or: Why Bother to Learn Windows PowerShell

In this session, Microsoft Scripting Guy ,Ed Wilson, discusses the fact that in addition to being the management future for Microsoft products, Windows PowerShell offers a number of compelling reasons for learning it. These reasons include the following: it is powerful and provides the ability to collect and to consolidate information from multiple remote systems into a centralized view of the data. It is safer than many other tools, and offers the ability to prototype a command prior to the command execution. There is also a confirmation mode that will allow a network administrator or other IT Pro the ability to selectively step through a group of commands to cherry pick commands to execute or ignore. Windows PowerShell also has built in logging that provides documentation of not only what commands are executed, but the resultant output from those commands. In addition, Windows PowerShell contains numerous features to promote a high level of discoverability and intuitive usability. This session is heavy with practical tips and demonstrations.

Session 2Heard It Through the Pipeline or: How to Compound PowerShell Commands for Fun and Profit

One of the most basic and one of the most powerful features of Windows PowerShell is the pipeline. By using the Windows PowerShell pipeline, one can take a basic set of cmdlets and build a nearly infinite assortment of useful commands. And yet, all of this boils down to using the pipeline to perform essentially four types of activities. The first is to use the pipeline to retrieve items and to work on them. The second is to use the pipeline to filter out data. The third basic use of the pipeline is to persist information. Lastly, the use of the pipeline to format output. In this session, all four basic uses of the pipeline are covered with a heavy dose of demos.

Session 3Sole Provider? Not Hardly or: A Look at Windows PowerShell Providers

One of the revolutionary concepts in Windows PowerShell is the idea of PowerShell providers. Windows PowerShell providers provide a singular way to access different types of data that are stored in different locations. Default providers include a file system, registry, alias, variable, function, and environmental variable. This means that one can use Get-Item to access content stored in any of these locations. Not only that, but these providers are extensible, which means that Microsoft teams (and non-Microsoft developers) can create additional providers.

Session 4The Main Event or: PowerShell Does Event Logs

Regardless of one’s position, it seems that at some point or another everyone will be involved in looking at event logs. And why not…especially since Windows has such great logging support. Whether it is for security reasons, troubleshooting reasons, or general Windows health monitoring, the logs contain nearly all of the required information one seeks. In this session, Microsoft Scripting Guy, Ed Wilson, discusses the classic and the newer ETW style of logs, and looks at the tools that are used with each type of log.

Session 5More than Remotely Possible or: Using PowerShell to Manage the Remote Desktop

Let’s face it, even though there are lots of commercial products out there that assist in managing desktops,or servers, most are very complex, and they require a dedicated support team to manage them. Even in organizations where such tools exist, the teams agenda, and the front-line admin’s agenda often clash. For adhoc situations, using Windows PowerShell to manage remote machines fills-in the gray area. In this session, Microsoft Scripting Guy, Ed Wilson,discusses using Windows PowerShell to manage remote machines.

I’d encourage anyone who hasn’t already begun, to learn PowerShell before it’s too late!

Microsoft IT Pro Camp, Newcastle, 27th March

Over the coming months, Microsoft are running events for IT professionals across the length and breadth of the UK, including a return to the North East. I went to the Microsoft Campus last week and had a taste of the new format, which is unlike the TechNet presentations of the past. These events are smaller and very interactive – there’s a real opportunity for attendees to shape the topics covered throughout the day.

As I said, these are smaller events, so you need to get registered fast! Here are all the details from Microsoft:

Event: Consumerisation of IT/ Manage consumer devices on a corporate network
Date: 27th March 2012
Location: Novotel Newcastle Airport, Ponteland Road, Kenton, Newcastle upon Tyne
Register: https://msevents.microsoft.com/cui/EventDetail.aspx?culture=en-GB&EventID=1032505034&IO=88vhg0ori7Fgb3FFMm3Ftw%3d%3d

This year the UK Tech.Days team have changed the format of our traditional Tech.Days theatre events into a series of ‘Boot Camp’ style seminars. The aim of these is to allow IT Professionals to have more discussion time with evangelists like Andrew Fryer, and each other to share common problems and solutions – and we’re looking for your help to share these with your users.

The Newcastle Event will host approx. 70 people with a mixture of discussions and practical demonstration. Although there will be a loose agenda, it will be PowerPoint-free event, allowing the hosts to focus on the questions that our guests ask.

For the event in Newcastle, we will be focusing on the Consumerisation of IT:
– How key Microsoft technologies such as System Center 2012, SharePoint 2010, Windows Server 2008R2, Exchange 2010 or Office 365 and Windows 7 come together to help you deliver flexibility and support for devices and desktops.
– How to use the latest tools to manage your estate, deliver applications flexibly, manage devices such as iOS and Android as well as Windows, implement IP Sec, reduce anti-malware costs, implement Direct Access and secure remote access.
– We’ll also help you think about what you need to build into a “Bring your own device” or BYOD policy.

Registrations are now open and can be found here

Imagine Cup North East

For the last couple of weeks I’ve been helping behind the scenes with Imagine Cup North East. If you’ve never heard of the Imagine Cup it’s an annual student competition run by Microsoft to build technology solutions to address real-world problems, and this year two great local organisations promoting digital industries, Codeworks and Sunderland Software City, have teamed up to run a regional heat.

This week students from Newcastle, Northumbria, Sunderland, Durham and Teesside universities and local colleges will be attending taster and information events (in Newcastle and Middlesbrough), where Microsoft’s Ben Nunney will be on hand to discuss the finer points of the competiton.

The competition is a great opportunity for students to work on a project outside of their studies (looks good on the CV, etc) and it should be good fun too, with a 36 hour hack event later in the month. Of course there’s also the possibility of a trip to the global finals in Australia to aim for too!

If you’re a current student (or graduated in the last year) there’s still time to get involved, and if you aren’t eligible to take part, you should still be able to support the teams at a future NEBytes event. Head to the Imagine Cup North East site, the Facebook page, and follow @ImagineCupNE on Twitter to keep up with all the goings-on.

Windows 7 now the most used OS on campus

It’s been a while since I did these stats, and I don’t think I’ve ever blogged them before, but I was prompted to check this after hearing Microsoft say that Windows 7 has overtaken previous versions worldwide.

It turns out that even though there hasn’t been any particular institutional drive towards Windows 7, thanks to the efforts of pro-active staff across the University, it does now significantly outnumber all other operating systems in our Active Directory combined! In the last 3 months, the breakdown of computers is…

Windows 7: 7155
Everything else: 5385

There are an unknown number of machines that aren’t connected to Active Directory, but the spread of those won’t affect this a great deal.

Another interesting stat that I heard recently came from Dell. They now predict that 50% of all server workloads are virtualised. Thats probably about true here – I’ll see if I can get those stats later.

Incidentally, the breakdown of Windows servers in our AD sees roughly equal numbers of Server 2008 R2 and Server 2003 (just over 200 of each), and just over a hundred running Server 2008.

If anyone is interested in grabbing these stats in their own organisation (or OU), then it’s just a simple bit of PowerShell using the Quest AD cmdlets

$computerObjects = Get-QADComputer `
-IncludedProperties pwdLastSet -SizeLimit 0
$recentComputers = $computerObjects | `
Where {$_.pwdLastSet -ge ((Get-Date).AddDays(-90))}
$recentComputers | Group OSName | `
Sort Count -Desc | Format-Table Count,Name -AutoSize

(That’s just 3 lines of code, but it could be fewer. The ` character extends the line in PowerShell)

Pre-staging Computers in Active Directory for WDS with PowerShell and Quest AD cmdlets

One of the most common issues when buidling computers with Windows Deployment Services (WDS, and RIS before that) are typos in the GUIDs used to net-boot the PCs. When you’re entering them by hand as you pre-stage the computer objects in Active Directory it’s very easy to make mistakes, especially when you’re entering a lot of them. It’s also extremely time consuming if you have to boot each machine to the point of PXE displaying the MAC and GUID – that’s why the smart move is to request that information from the supplier, preferably before they deliver the machines.

Anyone who has pre-staged a computer object before will be aware of the jiggery-pokery that goes on with switching round the first half of the GUID, so that when you view it later in ADUC, you see something significantly different to what you typed in. It appear that this conversion is done by the GUI when you create the object, so when you’re adding them programatically, you need to change the format yourself.

Microsoft published a VBScript function to reformat the GUIDs so they could be added to AD by a script, but I haven’t seen similar in PowerShell, so here it is:

function flip-guid ([string]$g) {
$g = $g.replace("-","").replace(" ","")
-join $g.substring(0,16).tochararray()[6,7,4,5,2,3,0,1,10,11,8,9,14,15,12,13] + $g.substring(16,16)
}

The function takes the GUID as a string and first removes any dashes or spaces (since I’ve received them from suppliers with both at different times). Next it converts the first half into an array of characters, selects them back in the new order and uses the join operator to make them back into a string, to which it concatenates the second half, unchanged from the original. As with most things in PowerShell it could be reduced down to a single line, or expanded further to enhance readability.

So, given the ability now to change the format, I use Quest’s AD cmdlets (if you haven’t come across these before, take a look now!) to create the computer objects. Assuming that you have a CSV file containing the new PC’s name and GUID, just do this…

Import-Csv newpcs.csv | foreach {
New-QADComputer $_.name -ParentContainer "SomeOU" -ObjectAttributes @{netbootguid = ([guid](flip-guid $_.guid)).ToByteArray()}
}

That’ll leave you with a load of new computer objects ready for WDS. 🙂

NB. It’s likely that the code snippets above have been wrapped to fit the page layout. In the function there are only two lines – everything from “-join” to the end is the same line. In the foreach scriptblock that’s just a single line.

Free PowerShell eBooks

Windows PowerShell is slowly taking over the world in terms of automation and administration of Microsoft products and beyond. For many Windows IT pros who are used to working with GUI interfaces there can be quite a learning curve, but thankfully the PowerShell community is producing some really great resources to help people learn and use PowerShell, including a collection of free eBooks. Jason Hofferle has helpfully compiled them into a single blog post: List of Free PowerShell eBooks

These books are authored by some of the brightest and best names in PowerShell, so I can’t recommend them highly enough.

Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1)

Since the release of Windows 7 SP1, people who installed the Service Pack before installing the RSAT package weren’t able to do so (although if you installed RSAT before SP1 you were fine).

Microsoft have resolved this with the release of Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1): http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d

The dangers of using the bin to store things you want to keep

When you build IT systems and you put limitations on how they are intended to be used, it goes without saying that people will try to find ways of getting round those limitations. We’ve always been fairly liberal about what users can do with our systems, but there are some times that we have to put limits in place. For example, we don’t have an unlimited amount of disk space, so we have to put quotas on storage capacity for each user’s email and files.

It turns out that some people try to work around these quotas by deleting email messages or files that they want to keep and take advantage of Exchange’s Recover Deleted Items feature and the shadow copies of home folders on file servers (seen as Previous Versions in Windows Explorer). Some people may get away with working like that for some time, simply recovering the content during the retention period and then deleting it again so that it doesn’t impact their quota.

As a way of working that’s about as safe as storing your important paperwork in the bin and hoping that you’re always there to take it out before the cleaner comes along to empty it. From time to time, routine maintenance on the file servers will result in shadow copies being lost – it’s not that we’re being careless with them; that’s just the way it works. If your mailbox has to be moved from one Exchange mailbox store to another, you’ll lose the ability to recover your deleted items. We try to keep these instances to a minimum because those features are useful for quickly recovering when accidents do happen, but sometimes they are necessary in the course of keeping the systems running as reliably as possible.

Throwing things away and then hoping that the bin doesn’t get emptied is not a solution. If there are legitimate reasons why your quota isn’t big enough, then there are better ways to work. We have a system for requesting increases to home folder quotas and a Home Archive Service for infrequently accessed data (and other solutions for even bigger data requirements, such as large sets of research data), and we have an Exchange Archiving System to store larger amounts of old mail. If none of those meet the specific need, then we’re happy to help to find a solution that works.

Free e-book: Keep Yourself and Your Stuff Safe Online

Microsoft has teamed up with author Linda McCarthy to offer a free downloadable version of her new book Own Your Space – Keep Yourself and Your Stuff Safe Online. The book covers a variety of computer security and online safetly topics and is aimed at internet savvy teens, as well as parents and educators. Personally I’d say that the chances of teens reading it all the way through aren’t great, but parents of online offspring should definitely get up to speed with this stuff.

Frankly I’d recommend that anyone who uses the internet and isn’t as capable as Sarah Connor at fighting off the machines, should read this.

Own Your Space

Both PDF and XPS versions are available at the Microsoft Download Center.