Tip of the Week 4 – DISM Cleanups

In the last post I covered DISM for the purpose of changing/upgrading the version of Windows, and we found that the DISM tool has existed since 2008, however in 2012R2 they added much improved, usable functionality. Did you know DISM is also responsible for things such as Windows updates?

Under the hood DISM is the tooling being used to install and maintain those wonderful Windows Updates you get every month on Patch Tuesday (is that still a thing?) Which also means we can use the toolset to also tidy up afterwards. Remember Disk Clean up (cleanmgr)? Well it’s a nicer CLI version of the Updates clean-up in there.

There are 3 levels of update clean up via DISM

  • Component Clean up – this cleans up updated components i.e. removing the packages used to install the updates
  • Reset Base – same as above, but means all deletes all superseded versions of every component in the component store, meaning you won’t be able to uninstall service packs/updates applied before this point in time
  • SPSuperseded – removes all backup components needed to uninstall the service pack, also you cannot remove the service pack anymore after using this command.

In short doing 2 and 3 will free up more space but makes rolling back very difficult, option 1 is a nice way to keep the system tidy:

Example on Windows Server 2012R2

  • Disk is at 37.1GB free after being fully updated and having key applications installed

  • Component cleanup is run and takes quite a while… (I had to go out and check 3 hours later, suspect it took ~1 hour)

  • Following the cleanup run we can see around 7GB has been freed up on the system

From this quick demonstration above it’s clear to see that significant disk space is used up by irrelevant, outdated files. The only reason to keep these is if you want to remove an update and reapply later, but surely not all 7GB worth…

I’ve started using the dism cleanup commands during my build process, so that before I start using a server in anger, I get it to as clean a state as possible, fully updated but tidy!

The full commands for DISM cleanup are:

  • dism /online /Cleanup-Image /StartComponentCleanup
  • dism /online /Cleanup-Image /StartComponentCleanup /ResetBase
  • dism /online /Cleanup-Image /SPSuperseded

2017 Stats

In my last post I mentioned that I thought my install stats were somewhere in the 3-4 per month range, turns out I wasn’t too far off on that.

Last week I spent a little time updating my personal documentation and pulling together numbers etc. more so for my own confidence boost but also so I have some collateral to back myself up.

The stats read as follows:

please note I only started making my own notes outside of time entry/calendars in March 2017:

In 7 Months:

  • 24 Technical Engagements (categorised as over half a day solid consulting, not including “support” style assistance) – >3 per month
  • 22 different customers
  • 6 Go-lives supported (3 new/3 upgrades)
  • 8 international projects supported with training/documentation reviews etc.
  • 5/24 were on site engagements
  • 2 formal sysadmin training cources delivered
  • 4 cloud-based upgrades

So yes, I am in the 3-4 per month category and it’s nice to realise I am in the area I thought!

2016 Update

If you have seen my other (more personal) blog you will have come across the post I did recently regarding how 2016 has flown by and so many things have changed career wise. If you’ve not read that feel free to jump on over here: http://johnnyward.me.uk/newblog/a-year-of-two-halves/

As this is my technology blog I though I’d share a quick update on skills and technologies that have advanced through this year, the most noticeable are:

  • SQL Skills – yes I know more than just installing now, I can troubleshoot performance issues and tweak setups to ensure a nice smooth running system.. Maintenance of SQL is also one of my most common tasks across many customers.
  • ERP – a broad subject, but I will break down a little. Firstly I am more than capable of a “vanilla” install of Epicor ERP 10/10.1, I’m also capable of updating/upgrading those platforms. On top of that I can also talk tech with IT/ERP managers across all industries to help spec, and install/deploy the Epicor ERP platforms. This also includes a number of additional installs (such as web, Enterprise Search, education tools etc.) and enhancements, such as those for document management and CRM.
  • Hyper-V – not something I’d had the opportunity to play with much before, however I am now capable of installation, deployment, management and maintenance of Hyper-V 2012+ platforms, and I have to say, what a great platform it is.
  • VMware ESX – my knowledge in VMware has also jumped this year, having had the opportunity to manage 2x ESX 6 environments in recent months and upgrade a couple of 5s to 5.5 I am once again familiar with the VMWare suite and as always find it an exciting challenge.
  • Remote Desktop Services – sure we all know a little Terminal Services from back in the day, but having now deployed around 5 of these 2012R2 beauties this year, i am exceptionally impressed. Easy to install and configure, and just as easy to troubleshoot and fix, provided you have the time and mental space in order to do so!

Coming up in 2017…

So it seems there may be a few changes ahead, ones that will potentially make my career, and about time too!

The biggest 2017 challenges seem to be:

  • Cloud – funnily enough the UK hasn’t quite taken to it fully yet…
  • Solutions – how can a product be further enhanced to meet a customer’s longer term goals…
  • Tools – might need a course in C# and a few late nights

Watch this space…

Updated Batch Installer Script

So it’s been around a year since I first created the automatic installer script for when we deploy new machines. And it has been a huge success, cutting down deployment time significantly, and meaning we can easily do more than one at a time.

I realised that as it’s been a year, and every product under the sun has a vulnerability in it, that I needed to update the script for the newer versions of the standard products we all know and love. Most notably Adobe Reader, Flash, Java Runtime and Microsoft Security Essentials. On top of these newer versions I also decided as our core business is based on JD Edwards, and it now supports Google Chrome that we should also have that included too.

Another addition that has been made is a simple file copy to create a new folder and put in standard internal documentation that helps people connect from home/customer sites and Accessing our proprietary software.

The latest updates are as follows:

@ECHO off

echo Installing Adobe Reader…

rem “[location]ProgramsStandard SoftwarenewpcAdobeRdr1000.exe” /sAll /msi /norestart ALLUSERS=1 EULA_ACCEPT=YES
rem instructions for compiling network installer can be found at: http://community.spiceworks.com/how_to/show/27718-install-update-adobe-reader-to-to-latest-adobe-reader-xi-11-0-2-using-cmd
msiexec.exe /i “[location]ProgramsStandard SoftwarenewpcAcroRead.msi” ALLUSERS=1 /q /norestart TRANSFORMS=”[location]ProgramsStandard SoftwarenewpcAcroRead.MST”
msiexec.exe /update “[location]ProgramsStandard SoftwarenewpcAdbeRdrUpd11003.msp” /qb /norestart
echo …done

echo Install ActiveX Flash…
rem “[location]ProgramsStandard Softwarenewpcflash_iexplore.exe” -install
msiexec /i “[location]ProgramsStandard Softwarenewpcinstall_flash_player_11_active_x.msi” /qn
echo …done

echo Install Browser Flash…
rem “[location]ProgramsStandard Softwarenewpcflash_firefox.exe” -install
msiexec /i “[location]ProgramsStandard Softwarenewpcinstall_flash_player_11_plugin.msi” /qn
echo …done

echo Installing Java Runtime…
rem “[location]ProgramsStandard Softwarenewpcjava.exe” /s
“[location]ProgramsStandard Softwarenewpcjava_new.exe” /s
echo …done

echo Installing Microsoft Security Essentials…
rem “[location]ProgramsStandard Softwarenewpcmse.exe” /s /runwgacheck /o
“[location]ProgramsStandard Softwarenewpcmse_new.exe” /s /runwgacheck /o
echo …done

rem –install chrome–
echo Installing Google Chrome…
msiexec /q /i “[location]programsstandard softwarenewpcchrome.msi”
echo …done

rem –Copy Useful Docs–
echo Copying BMS Useful Documents…
mkdir “%USERPROFILE%DesktopBMS Guides”
xcopy “[location]batch scriptsDocs*” “%USERPROFILE%DesktopBMS Guides” /Y /q
echo …done

rem –DONE–
echo Installer Complete!
pause

NOTES:

I have left in the older code to compare the differences (if any) in the install commands.

The Adobe installs are now done using a great little utility which you can download from the Adobe website, this helps create a transform file which is basically a set of rules that define the install parameters. The adobe reader install needs a base install of Version 11 and then the update package on top, at time of writing update 3 is the latest, in theory when update 4 is available you should be able to download the file to the standard location and then change the code to reflect this version. The instructions I followed can be found here: http://community.spiceworks.com/how_to/show/27718-install-update-adobe-reader-to-to-latest-adobe-reader-xi-11-0-2-using-cmd

The Google Chrome MSI is available from here: http://www.google.co.uk/intl/en-GB/chrome/business/browser/admin/

For security purposes I have modified the file paths for this post.