Monday, 29 June 2015

Converting install.wim

 "It's not what you look at that matters, it's what you see."

If you're like me, you have wondered what this strange install.esd file is that came with Windows 8.1 Update which was obtained via official channels. It replaces the install.wim that is usually found on Windows installation media.

(All actions were performed on a technician computer running Windows 10 Insider Preview x64 Pro En-US build number 10.0.10130)

Let's have a look by mounting the ISO.

This is the Windows 10 preview (10130).

As you'd expect, in the sources folder there are two WIM files install.wim and boot.wim

This is the Windows 8.1 Update Pro x64 En-US ISO, downloaded from Microsoft's website.

The install.wim has given way to an ESD file (install.esd), an Electronic Software Download (ESD).

The compression rate of the ESD files is even higher than the compression rate of WIM files using the /compress:max switch.

ESD files however, resists some operations like deployment using a WDS server. There is a need to convert the ESD file to a WIM file. 

There is approximately a ton of 3rd party tools out there just for that purpose, many of which sport a fancy GUI. I will demonstrate that none of these tools has its use, because we can do everything we need with dism.

 I created a work folder

C:\>md deplyoment8.1u
C:\>md deplyoment8.1u

C:\>cd deplyoment8.1u


 Volume in drive C has no label.

 Volume Serial Number is ***

 Directory of C:\deplyoment8.1u

06/30/2015  12:38 AM    <DIR>          .

06/30/2015  12:38 AM    <DIR>          ..

06/29/2015  09:57 PM       262,242,670 boot.wim

06/29/2015  09:58 PM     2,794,179,280 install.esd

               2 File(s)  3,056,421,950 bytes

               2 Dir(s)  197,991,677,952 bytes free


Time to see what is inside the WIM, ESD files.

 dism /Get-WimInfo /WimFile:boot.wim

Deployment Image Servicing and Management tool

Version: 10.0.10130.0

Details for image : boot.wim

Index : 1

Name : Microsoft Windows PE (x64)

Description : Microsoft Windows PE (x64)

Size : 1,207,581,322 bytes

Index : 2

Name : Microsoft Windows Setup (x64)

Description : Microsoft Windows Setup (x64)

Size : 1,309,445,510 bytes

The operation completed successfully.


 dism /Get-WimInfo /WimFile:install.esd

C:\deplyoment8.1u>dism /Get-WimInfo /WimFile:install.esd

Deployment Image Servicing and Management tool

Version: 10.0.10130.0

Details for image : install.esd

Index : 1

Name : Windows 8.1 Pro

Description : Windows 8.1 Pro

Size : 13,185,962,705 bytes

The operation completed successfully.


Conversion install.esd to install.wim

 dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity
C:\deplyoment8.1u>dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity

Deployment Image Servicing and Management tool
Version: 10.0.10130.0

Exporting image
The operation completed successfully.


Behold the WIM file and its content


 Volume in drive C has no label.

 Volume Serial Number is ***

 Directory of C:\deplyoment8.1u

06/30/2015  01:05 AM    <DIR>          .

06/30/2015  01:05 AM    <DIR>          ..

06/29/2015  09:57 PM       262,242,670 boot.wim

06/29/2015  09:58 PM     2,794,179,280 install.esd

06/30/2015  01:01 AM     3,547,816,622 install.wim

               3 File(s)  6,604,238,572 bytes

               2 Dir(s)  194,344,812,544 bytes free


 dism /get-wiminfo /wimfile:install.wim
C:\deplyoment8.1u>dism /get-wiminfo /wimfile:install.wim

Deployment Image Servicing and Management tool
Version: 10.0.10130.0

Details for image : install.wim

Index : 1
Name : Windows 8.1 Pro
Description : Windows 8.1 Pro
Size : 13,185,962,705 bytes

The operation completed successfully.


Monday, 25 May 2015

Hyper-V Server: Un-instaling software using command prompt

This tutorial covers Hyper-V Server, not to be confused with Windows Server core installation with the Hyper-V role installed. That being said, this short tutorial should work for both scenarios.

First, I'd like to check what software is actually installed on the server

 wmic product get name,version,vendor
 C:\>wmic product get name,version,vendor
Name                                                         Vendor
Microsoft System Center 2012 R2 DPM Protection Agent         Microsoft Corporati
on  4.2.1292.0
Microsoft Visual C++ 2010  x64 Redistributable - 10.0.30319  Microsoft Corporati
on  10.0.30319


In this case I have an outdated version of the System Center Data Protection Manager 2012 R2 Protection Agent on my server.

Trying to install the latest version of the protection agent end in failure as long as the old version is installed, but that is a story for another blog entry.

Uninstalling the application in the command prompt

I took note of the name of the application I need to uninstall during.

Microsoft System Center 2012 R2 DPM Protection Agent
wmic product where name="Microsoft System Center 2012 R2 DPM Protection Agent" call uninstall

 The result

 C:\>wmic product where name="Microsoft System Center 2012 R2 DPM Protection Agen
t" call uninstall
Executing (\\HYPER-V\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{6FA0CE18-E1A
B-4CA2-B552-03D16516E174}",Name="Microsoft System Center 2012 R2 DPM Protection
Method execution successful.
Out Parameters:
instance of __PARAMETERS
        ReturnValue = 0;


 Supplemental: Wildcards

A batch script that uninstalls everything DPM would look like this
C:\Windows\System32\wbem\wmic product where "Name like '%%DPM%%'" call uninstall

Friday, 8 May 2015

Installation of DPM 2012 R2 on Windows Server 2012 R2 in Hyper-V

This will walk you through the installation of System Center Data Protection Manager 2012 R2 (DPM 2012 R2) on Windows Server 2012 R2 Standard in a Hyper-V virtual environment.

The environment:

  • On-premises Hyper-V using Microsoft Hyper-V Server 2012 R2

Storage Pool
The DPM will use a Direct Attached Storage (DAS) configuration with two physical HDDs for the storage pool.
  • 3 TB SATA HDD 
  • 8 TB SATA Shingled magnetic recording (SMR) archive HDD. 

File Photo Seagate ST8000 Archive HDD (4)

The HDDs will be made available to the DPM server as virtual hard disks (VHDX).

The DPM's databse will be hosted on the locally installed Microsoft's SQL 2012 Standard with SP1.

Setting up the virtual machine

Before I can start, I need a virtual machine with Windows Server 2012 R2 installed and fully patched. I create a generation 2 vm with a max memory of 8 GB dynamically assigned vRAM.

Note that the storage pool disks will be added later.

Installing SQL Server 2012 SP1 Std x64

You could also use SQL 2014 as DPM's database. Support for SQL 2014 was added in one of the U
update rollups but for this installation I will use SQL 2012 with SP1.

Prerequisite .NET Framework 3.5 (1)
I added a virtual SCSI DVD-ROM drive and inserted the Windows Server 2012 R2 Std DVD. This installed .net.(2)

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Windows\system32>DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /Limit
Access /Source:d:\sources\sxs

Deployment Image Servicing and Management tool
Version: 6.3.9600.17031

Image Version: 6.3.9600.17031

Enabling feature(s)
The operation completed successfully.

 Several Windows Updates will be unlocked:
After the update installation, I ejected the virtual DVD and attached the virtual SQL installation DVD. I chose to install a new standalone installation.


In this screen I chose to install the Standard edition the way it comes with DPM 2012 R2. The product key is entered automatically. Express or Evaluation edition do not suffice.

The installer installed two SQL updates during the installation.

In the next screen I selected "feature installation" and all that is needed accroding to the requirements of DPM is:
  • Instance Features\Database Engine Services
  • Instance Features\Reporting Service - Native

And I decided to install the Management Tools
  • Shared Features\Management Tools - Basic
  • Shared Features\Management Tools - Complete

"Default Instance".

Now it is time to create one Domain account that will be used to run the SQL services. (3)

  • SQL Server Agent
  • SQL Server Database Engine
  • SQL Server Reporting Services

The database engine will use Latin1_General_CI_AS

Choose Windows authentication mode and choose one or more domain groups that will be the SQL administrators.

On the Reporting Services Native Mode prompt choose Install and configure.

The installation completed successfully.

Installing DPM 2012 R2

I inserted the DPM installation disc ISO into the virtual optical drive and started the DPM installation.

 In the prerequisites check, I entered the hostname of the virtual machine that was supposed to host both the SQL and the DPM and clicked Check and Install.


DPM setup proceeded to install basic missing Windows components and asked for a restart.

On second attempt, I was able to proceed.

It is time to enter the product key.

There are a few options some of them rather inconsequential (Customer Experience Improvement Program) like the installation path. The installation path is not where the backups will go,


Installing Updates

I wanted to install all the updates most above all SP2 for SQL 2012 and the Rollup 6 for DPM 2012 R2.

Another reboot is due.

 Readying the Storage Pool

On the hyper-v host, vhdx file were created on each physical storage pool disk

3 TB disk > F:\vhds\dpm data 1.vhdx (~3 TB; dynamically expanding)
8 TB disk > G:\vhds\dpm data 2.vhdx (~8 TB; dynamically expanding)

In the VM, i brought the disks online and initialized them as GPT. Disk type basic.

Using the DPM management console \ management tab, I added the disks to the storage pool:

The populated storage pool shows 10 TiB,

Q & A

Why did you not use pass through disks for the storage pool?
Firstly, because VHDX files are now a supported scenario and secondly because Microsoft has indicated that the pass through disk feature might be deprecated or and eventually removed in the future. Also, the virtual machine is supposed allow an easy live migration.

(1) Hardware and Software Requirements for Installing SQL Server 2012
(2) Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM)
(3) Set up the SQL Server database for DPM

Monday, 2 March 2015

 Moving the WSUS 4 Database

"If it wasn’t for that last minute, nothing would ever get done."

Why might you want to do this in the first place? Having a database on the system drive is generally a bad idea. WSUS uses the Windows Internal Database which is located in the Windows folder. Having a database on a separate volume is generally a good idea, if only for performance reasons. 


1) Designate a new location for the database. Perhaps SSD or NAS based storage.

2) Like any WSUS administrator sooner or later realises, I had been given a database but no means to administer it.  I downloaded and installed the SQL Express Management Studio (SQL Server 2012 SP2, SQLManagementStudio_x64_ENU.exe)

3) Stop the WSUS service (services.msc)

4) Locate your WSUS Windows Internal Database (WID)

 C:\>dir c:\windows\WID\Data
 Volume in drive C has no label.
 Volume Serial Number is ****-****

 Directory of c:\windows\WID\Data

02.03.2015  22:18    <DIR>          .
02.03.2015  22:18    <DIR>          ..
02.03.2015  00:40         4.194.304 master.mdf
02.03.2015  00:40         1.048.576 mastlog.ldf
02.03.2015  00:40         2.162.688 model.mdf
02.03.2015  00:40           524.288 modellog.ldf
02.03.2015  00:40        13.107.200 msdbdata.mdf
02.03.2015  00:40           524.288 msdblog.ldf
02.03.2015  22:19     3.816.882.176 SUSDB.mdf
02.03.2015  22:19        25.296.896 SUSDB_log.ldf
02.03.2015  21:51        40.960.000 tempdb.mdf
02.03.2015  21:05        22.675.456 templog.ldf
              10 File(s)  3.927.375.872 bytes
               2 Dir(s)  112.296.820.736 bytes free


Making the move

In Management Studio, I connected to


I expanded Databases and detached the SUSSB

In this case the destination is a folder on volume d:. d:\WSUS DB

Moving the DB (elevated command prompt):

C:\>move c:\windows\wid\data\susdb* "d:\WSUS DB"
        2 file(s) moved.


It is too soon to re-attach the db. It would result in a read error or the database would be mounted as read-only. I needed to copy the NTFS permissions (ACL) first

PS C:\Windows\WID\data> Get-ACL | fl

Path   : Microsoft.PowerShell.Core\FileSystem::C:\Windows\WID\data
Owner  : BUILTIN\Administrators
Group  : BUILTIN\Administrators
Access : NT AUTHORITY\SYSTEM Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
         NT SERVICE\MSSQL$MICROSOFT##WID Allow  Write, Delete, Read, Synchronize
         NT SERVICE\MSSQL$MICROSOFT##WID Allow  -1073676288
Audit  :
Sddl   : O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;;0x13019f;;;S-1-5-80-1184457765-4068085190-3456807688-22009523

PS C:\Windows\WID\data>

This entry is most important: NT SERVICE\MSSQL$MICROSOFT##WID , but I copied the ACL as a whole.

PS C:\Windows\WID\data> Get-Acl C:\Windows\WID\Data | Set-Acl -Path 'D:\WSUS DB'
PS C:\Windows\WID\data>

In SQL Management Studio, I re-attached the database.


 Next I started the WSUS service.