Updates from QA Training

Windows Server 2012 Role & Feature Source File Removal

With Windows Vista and Windows 7 we had tools that enabled the removal of old source files once a service pack has been applied. With Windows Server 2012 Microsoft has provided a way to remove all the source files for the unneeded roles and features


Paul Gregory | 12 April 2013

With Windows Vista and Windows 7 we had tools that enabled the removal of old source files once a service pack has been applied. With Windows Server 2012 Microsoft has provided a way to remove all the source files for the unneeded roles and features

Windows Server 2012 is the same as most recent versions of Windows and that most of the source files, (the exceptions are PS v2 and previous versions of .net), are stored on the hard disk in the WINSxS folder inside the Windows directory. These files take up about 1.7GB. In addition when the system is updated these files get updated two so you end up with multiple versions of these files on the disk. Therefore the ability to remove unneeded source files not only helps with this but would also reduce the OS footprint size which can help when building images, VM templates and increasing density of VM with reduce storage consumption on LUNs.

The basic command is the Uninstall-WindowsFeature PowerShell command with the - Remove option to remove the source files. To be able to remove all the source files for uninstalled features the command would be:

Get-WindowsFeature | Where-Object installedstate -eq "available" | Remove-WindowsFeature -Remove

The question now is what if a feature needs to be installed that has had its source files removed. When installing the new feature (either through Server Manager or PowerShell) the source location can be specified.  The great thing about this feature is you can either download the content from the Windows Update site or point it directly at the WIM file using the format below:

WIM:E:\Sources\Install.wim:4

This command specifies the source object is a WIM file with the WIM: option, next the location of the WIM file, and lastly the specific image in the WIM file.

Please watch this video to see this feature in action, or attend a training course on Windows Server 2012   @QATraining  

 

Paul
paul.gregory@qa.com
Principal Technologist
Follow me on Twitter or see my YouTube channel

QA Training | Paul Gregory

Paul Gregory

Head of Microsoft Infrastructure

A Microsoft Certified Trainer since 1995, Paul has worked both for and with some of the world's leading IT Services organisations – including Unisys, Dell and Microsoft during the Microsoft Windows (TAP) Technology Adoption Programme. Paul specializes in delivering training around the Windows Operating system as well infrastructure and management solutions around System Center going right back to SMS 1.0. Paul is a frequent visitor to Microsoft's Global Headquarters in Seattle to attend early product workshops and for many years has delivered training courses around the world on behalf of Microsoft. In addition to being actively involved in Microsoft's Windows TAP programme, Paul has recently delivered both Microsoft's Private Cloud 2012 readiness training to partners in the UK and was a member of the Microsoft global training team delivering Windows Server 2012 early adopter training. During recent years Microsoft has requested Paul to deliver System Center training at both Redmond and The South American head office to Microsoft Partners.
Talk to our learning experts

Talk to our team of learning experts

Every business has different learning needs. QA has over 30 years of experience in combining the highest quality training with the most comprehensive range of learning services, ensuring the very best fit for your organisation.

Get in touch with our learning experts to talk about how we can help.