Disable Pervasive Notification Viewer

If you’re using the Pervasive PSQL engine, you’ll probably have the Pervasive Notification Viewer in the systray. It’s a small application that notifies you of anything related to the PSQL engine. The application itself uses about 20 MB of RAM, which can lead to a lot of wasted memory if running on a remote desktop server. The application launches from a shortcut in the global startup start menu folder, which is buried here:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

The file is called “Run Notification Viewer in background.lnk”.

You can delete it, but it’s better to move this file to your own personal startup folder, for example as Administrator:

C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

That way the notification viewer only runs when the Administrator logs in, so you’ll still be apprised of any licensing or other Pervasive PSQL troubles that run through the notification viewer.

Improve the Windows Server 2012 Remote Desktop experience by using UDP

Server 2012 (and in turn Windows 8) has a nifty new feature in its Remote Desktop component, namely the ability to use UDP as transport for its data. The great thing about it, is you don’t have to do anything to enable it. And indeed, with a default remote desktop deployment we can see the server is already listening to UDP port 3389 and a firewall rule is present:

rdp-udp

rdp-udp-3

The client will automatically attempt to use UDP and will fall back to TCP if it can’t (note that authentication, etc… still happens using TCP). We can tell if the client is connected using UDP by clicking the quality icon:

rdp-udp-2

Adjusting the network

You will need to modify any firewall policies/port forwardings on other devices to allow connections to UDP destination port 3389. If you’re used to forwarding port TCP port 3389, include UDP port 3389 as well.

Windows 7

These changes come with Remote Desktop Protocol version 8.0, so you need at least that version of the client too to be able to use this feature. Windows 8 already ships with the 8.0 Remote Desktop client, if you’re running Windows 7 you can download version 8.1 of the Remote Desktop client here:

If you are a home user running Windows 7 and you are connecting to it using Remote Desktop you can also take advantage of this new feature:

  • Install this update: “Description of the Remote Desktop Protocol 8.0 update for Windows 7 SP1 and Windows Server 2008 R2 SP1” http://support.microsoft.com/kb/2592687
  • Follow the steps (in the same article) in the “How to enable RDP 8.0 on a remote computer that is running Windows 7 SP1” paragraph.
  • Install the latest Remote Desktop Client on any computers you use to connect to your own.

Unfortunately this does not work for Windows Server 2008 R2, you will need to upgrade to Server 2012 for that.

End result

By my testing, the ability to use UDP did increase responsivity and screen rebuild time when accessing the server over the internet. It is actually quite an improved experience, the typical RDP lag you used to notice is almost entirely gone and the animations are much more fluent. By using UDP we get rid of the time it takes to acknowledge the transceived data by the client and allowing it to immediately flow to the user.

Remote Desktop: printer names not matching / event ID 1111

Sometimes, printer drivers names can differ between different Windows versions. This is problematic when connecting to a remote desktop server, as the printer’s name is used to look up the correct driver to use. When the printer driver names do not match, event ID 1111 will occur in the Windows Event Log, for example:

Driver RICOH Aficio 2018 PCL 6 required for printer RICOH Aficio 2018 PCL 6 is unknown. Contact the administrator to install the driver before you log in again.

When you look at the installed driver list on the remote desktop server, we see:

Ricoh Aficio 2018 PCL6

Note the lowercase manufacturer and the removed space between “PCL” and “6”. The solution is to create a mapping file that matches up the printer’s names, again allowing successful waste of paper.

Modify the registry

First we must tell Remote Desktop Services where to find our mapping file. To do that, open the registry and navigate to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd

Add two new string values

  • Value Name: PrinterMappingINFName
  • Value Data: C:\printmap.inf
  • Value Name: PrinterMappingINFSection
  • Value Data: Printers

printermap

Create the mapping file

Next, create a plain text file, C:\printmap.inf, with the following content:

[Version]
Signature=”$CHICAGO$”
[Printers]
“RICOH Aficio 2018 PCL 6” = “Ricoh Aficio 2018 PCL6”
“Brother DCP-560CN Printer” = “Brother DCP-560CN”

printermap2The format of the “Printers” section is as follows:
Left-hand side: name as presented by the client (what the client reports and what you see in the event log)
Right-hand side: correct printer name as listed on the server (the driver’s name listed in print management)

You can add multiple printers.

Logoff and logon

The user should log off and log back on again. The printer should now be installed and the event ID 1111 shouldn’t occur anymore.

Add iSCSI initiator to the Windows Server 2008/2008R2/SBS 2008/SBS 2011 installation DVD

Goal

These days, in large environments, iSCSI has become the defacto standard to make block storage readily available to other computers. A possible deployment scenario is attaching an iSCSI target to a Windows server to create backups using the built-in Windows backup software.

However, the Windows installation DVD (which is required for a BMR, Bare-Metal Restore) doesn’t come with the Microsoft iSCSI initiator. So we’re going to add it ourselves.

This works for all installation DVD’s starting with Windows Vista up to Windows 7 including all server versions.

Updates

25/01/2012: the registry entries are now a hyperlink to a file you can download. WordPress was leaving out the “\ 0” (without the space) which could lead to all sorts of errors including “initiator instance does not exist”.

Prerequisites

  • The Windows Automated Installation Kit, installed, specific for the operating system you wish to restore. If you want to restore a Windows 2008 server, you need the Windows Vista AIK, if you want to restore a Windows 2008 R2 server, you need the Windows 7 AIK.
  • A Windows Vista/7/Server 2008/Server 2008R2/SBS 2008/SBS 2011 DVD.
  • A clean Windows installation. Preferably install a new machine.
  • This also works with the Small Business Server 2008 or 2011 operating system. SBS 2008 is based on Windows 2008 Server (which, in turn, is based on Windows Vista) and SBS 2011 on Windows 2008R2 Server (which is based on Windows 7).

Caveats

  • The major release of Windows you wish to restore must match the DVD you’re creating. You cannot use a Windows 7 DVD to restore a Windows Vista/2008 Server and you cannot use a Windows Vista/2008 Server DVD to restore a Windows 7. So:
    • Restore Windows Vista/2008 Server -> Windows Vista AIK & DVD
    • Restore Windows 7/2008 R2 Server -> Windows 7 AIK & DVD
  • Basically we’re going to be ripping out the necessary components out of an existing Windows installation and put these components on the installation DVD.
  • We’re going to use the pre-installation environment from the Windows DVD because the pre-installation environment from the AIK, winpe.wim, doesn’t contain recenv.exe, what you need to restore a backup.
  • All systems involved should have the same architecture.

Stealing the iSCSI initiator components

For this you’ll need a clean installed Windows OS. You need to copy the following files from it:

%systemroot%\System32\drivers\msiscsi.sys
%systemroot%\System32\en-US\iscsicli.exe.mui
%systemroot%\System32\en-US\iscsicpl.dll.mui
%systemroot%\System32\en-US\iscsicpl.exe.mui
%systemroot%\System32\en-US\iscsidsc.dll.mui
%systemroot%\System32\en-US\iscsiexe.dll.mui
%systemroot%\System32\en-US\iscsilog.dll.mui
%systemroot%\System32\iscsicli.exe
%systemroot%\System32\iscsicpl.dll
%systemroot%\System32\iscsicpl.exe
%systemroot%\System32\iscsidsc.dll
%systemroot%\System32\iscsied.dll
%systemroot%\System32\iscsiexe.dll
%systemroot%\System32\iscsilog.dll
%systemroot%\System32\iscsium.dll
%systemroot%\System32\iscsiwmi.dll
%systemroot%\System32\oledlg.dll

Keep the tree intact.

Setting up the root

Open the Deployment Tools Command Prompt as Administrator and use the included copype script to set up the root:

In the command prompt:

C:\Program Files\Windows AIK\Tools\PETools>copype
Usage: copype [x86 | amd64 | ia64] destination

Example: copype x86 c:\windowspe-x86

C:\Program Files\Windows AIK\Tools\PETools>copype amd64 c:\tmp 
===================================================
Creating Windows PE customization working directory

    c:\tmp
===================================================

        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\bcd
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\boot.sdi
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\bootfix.bin
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\efisys.bin
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\efisys_noprompt.bin
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\etfsboot.com
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\fonts\chs_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\fonts\cht_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\fonts\jpn_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\fonts\kor_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\fonts\wgl4_boot.ttf
11 File(s) copied
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\boot\bootx64.efi
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\bcd
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\fonts\chs_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\fonts\cht_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\fonts\jpn_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\fonts\kor_boot.ttf
C:\Program Files\Windows AIK\Tools\PETools\amd64\EFI\microsoft\boot\fonts\wgl4_boot.ttf
7 File(s) copied
        1 file(s) copied.

Success

Updating path to include peimg, cdimage, imagex

   C:\Program Files\Windows AIK\Tools\PETools\
   C:\Program Files\Windows AIK\Tools\PETools\..\AMD64

c:\tmp>

You should now have the following directory structure:

Copying boot.wim from the installation DVD

Insert your Windows installation DVD and copy the following file

\sources\boot.wim

to

C:\tmp\ISO\sources

Mounting the .wim image

We must mount the boot.wim image using imagex, this will allow us to edit the files inside the .wim file. A .wim file can contain multiple images (that’s how they create DVD’s that can install multiple editions of Windows 7), so it’s important we supply the correct image_number argument. We can check which images a .wim file contains using the same imagex tool:

C:\tmp>imagex /info /?

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

IMAGEX [FLAGS] /INFO img_file [img_number | img_name] [new_name] [new_desc]

Returns the stored XML descriptions for the specified WIM or image.

  img_file - The path of the WIM file to be queried for XML information.
  img_number - The number that identifies an image within the WIM file.
  img_name - The name that identifies an image within the WIM file.
  new_name - The new unique name for the specified image.
  new_desc - The new description for the specified image.

Accepted FLAGS:

  /BOOT
  Marks a volume image as bootable. Available for Windows PE images only.

  /CHECK
  If not provided, existing checks are removed during updates.

  /TEMP
  Specifies the path where temporary files are stored.

  /XML
  Returns the output as well-formed XML.

Example:
  imagex /info d:\imaging\data.wim

C:\tmp>imagex /info C:\tmp\ISO\sources\boot.wim

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

WIM Information:
----------------
Path:        C:\tmp\ISO\sources\boot.wim
GUID:        {868be8f0-f22c-494b-b20a-e9d997a921e5}
Image Count: 2
Compression: LZX
Part Number: 1/1
Boot Index:  2
Attributes:  0x8
             Relative path junction

Available Image Choices:
------------------------
<WIM>
  <TOTALBYTES>168641635</TOTALBYTES>
  <IMAGE INDEX="1">
    <DIRCOUNT>2182</DIRCOUNT>
    <FILECOUNT>9853</FILECOUNT>
    <TOTALBYTES>985750801</TOTALBYTES>
    <HARDLINKBYTES>334277841</HARDLINKBYTES>
    <CREATIONTIME>
      <HIGHPART>0x01CB88D1</HIGHPART>
      <LOWPART>0xDB7CCA61</LOWPART>
    </CREATIONTIME>
    <LASTMODIFICATIONTIME>
      <HIGHPART>0x01CB88D1</HIGHPART>
      <LOWPART>0xDBE0C44B</LOWPART>
    </LASTMODIFICATIONTIME>
    <WINDOWS>
      <ARCH>9</ARCH>
      <PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
      <EDITIONID>WindowsPE</EDITIONID>
      <INSTALLATIONTYPE>WindowsPE</INSTALLATIONTYPE>
      <PRODUCTTYPE>WinNT</PRODUCTTYPE>
      <PRODUCTSUITE></PRODUCTSUITE>
      <LANGUAGES>
        <LANGUAGE>en-US</LANGUAGE>
        <DEFAULT>en-US</DEFAULT>
      </LANGUAGES>
      <VERSION>
        <MAJOR>6</MAJOR>
        <MINOR>1</MINOR>
        <BUILD>7601</BUILD>
        <SPBUILD>17514</SPBUILD>
        <SPLEVEL>1</SPLEVEL>
      </VERSION>
      <SYSTEMROOT>WINDOWS</SYSTEMROOT>
    </WINDOWS>
    <NAME>Microsoft Windows PE (x64)</NAME>
    <DESCRIPTION>Microsoft Windows PE (x64)</DESCRIPTION>
    <FLAGS>9</FLAGS>
  </IMAGE>
  <IMAGE INDEX="2">
    <DIRCOUNT>2413</DIRCOUNT>
    <FILECOUNT>10532</FILECOUNT>
    <TOTALBYTES>1072858042</TOTALBYTES>
    <HARDLINKBYTES>379422568</HARDLINKBYTES>
    <CREATIONTIME>
      <HIGHPART>0x01CB88D1</HIGHPART>
      <LOWPART>0xEA7C5A8E</LOWPART>
    </CREATIONTIME>
    <LASTMODIFICATIONTIME>
      <HIGHPART>0x01CB8951</HIGHPART>
      <LOWPART>0x471198E5</LOWPART>
    </LASTMODIFICATIONTIME>
    <WINDOWS>
      <ARCH>9</ARCH>
      <PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
      <EDITIONID>WindowsPE</EDITIONID>
      <INSTALLATIONTYPE>WindowsPE</INSTALLATIONTYPE>
      <PRODUCTTYPE>WinNT</PRODUCTTYPE>
      <PRODUCTSUITE></PRODUCTSUITE>
      <LANGUAGES>
        <LANGUAGE>en-US</LANGUAGE>
        <DEFAULT>en-US</DEFAULT>
      </LANGUAGES>
      <VERSION>
        <MAJOR>6</MAJOR>
        <MINOR>1</MINOR>
        <BUILD>7601</BUILD>
        <SPBUILD>17514</SPBUILD>
        <SPLEVEL>1</SPLEVEL>
      </VERSION>
      <SYSTEMROOT>WINDOWS</SYSTEMROOT>
    </WINDOWS>
    <NAME>Microsoft Windows Setup (x64)</NAME>
    <DESCRIPTION>Microsoft Windows Setup (x64)</DESCRIPTION>
    <FLAGS>2</FLAGS>
  </IMAGE>
</WIM>

C:\tmp\>

Mount the image. The one we want is the “Microsoft Windows Setup (x64)”, which has number 2.

C:\tmp>imagex /mountrw /?

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

IMAGEX [FLAGS] /MOUNTRW [image_file image_number | image_name image_path]

Mounts a WIM image with read/write permission, to a specified path.

  image_file - The path of the WIM file containing the specified image.
  image_number - The number that identifies the image within the WIM file.
  image_name - The name that identifies the image within the WIM file.
  image_path - The path where the specified image will be mounted.

Without FLAGS:

  Lists mounted images.

Accepted FLAGS:

  /CHECK
  Enables WIM integrity checking. If not provided, existing checks are removed.

Example:
  imagex /mountrw d:\imaging\data.wim 2 c:\mounted_images

C:\tmp>imagex /mountrw c:\tmp\ISO\sources\boot.wim 2 C:\tmp\mount

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

Mounting: [c:\tmp\ISO\sources\boot.wim, 2] -> [C:\tmp\mount]...

[ 100% ] Mounting progress

Successfully mounted image.

Total elapsed time: 47 sec

C:\tmp>

If we now visit C:\tmp\mount, what we see is actually the content of boot.wim.

Integrating the iSCSI initiator components

Copying files

Copy the files you retrieved from your source installation to where you mounted the boot.wim tree. The files must match in location, so if you had for example

C:\Windows\System32\iscsicli.exe

This must become

C:\tmp\mount\Windows\System32\iscsicli.exe

Verify all files stated above are present.

Modifying the registry

Next up is modifying the registry to integrate the iSCSI initiator driver in the Windows setup environment. Open the Windows registry editor (regedit.exe) and select the HKEY_LOCAL_MACHINE root. This will allow you to load an external registry file. We have to load two hives. Select File -> Load Hive and browse to:

C:\tmp\mount\Windows\System32\config\SYSTEM

Key Name: PE_Sys

Next up, load:

C:\tmp\mount\Windows\System32\config\SOFTWARE

Key Name: PE_Soft

The result should look like this:

Right click and save the following .reg file:

http://users.telenet.be/redshift/iscsi.reg

Then select File -> Import and import the .reg file you just downloaded.

Unload the loaded hives by selecting File -> Unload Hive on PE_Soft and PE_Sys.

You’re done, all necessary components have been integrated. If you want you can extra drivers (storage, networking, etc…) using the dism tool.

Saving changes to the .wim file

Make sure there are no open explorer windows on C:\tmp\mount and the registry hives are unloaded. We use the same imagex tool to commit the changes and unmount the .wim file:

C:\tmp>imagex /commit /?

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

IMAGEX [FLAGS] /COMMIT mount_path ["image_name"]

Commits the changes made to a mounted image without unmounting the image.

  mount_path - The path of the mounted image to commit.
  image_name - If the /append flag is set, then a unique image name must be provided.

Accepted FLAGS:

  /APPEND
  Captures the changes made to the wim into a new image in the wim.

  /TEMP
  Specifies the path where temporary files are stored.

Example:
  imagex /commit c:\mounted_images
  imagex /commit /append c:\mounted_images new_image_name

C:\tmp>imagex /commit c:\tmp\mount 
ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

Committing: [c:\tmp\mount]...

[ 100% ] Committing Image progress

Successfully committed image.

Total elapsed time: 19 sec

C:\tmp>imagex /unmount /?

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

IMAGEX /UNMOUNT [/COMMIT] [image_path]

Unmounts a WIM image from the specified path.

  image_path - The path to be unmounted.

Without FLAGS:

  Lists mounted images.

Accepted FLAGS:

  /COMMIT
  Saves changes to the mounted WIM file. If not specified changes are discarded.

Example:
  imagex /unmount /commit c:\mounted_images

C:\tmp>imagex /unmount c:\tmp\mount 
ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385

Unmounting: [c:\tmp\mount]...

[ 100% ] Mount cleanup progress

Successfully unmounted image.

Total elapsed time: 7 sec

C:\tmp>

You can combine these last two steps by using

imagex /unmount /commit c:\tmp\mount

Creating a bootable ISO

We use the oscdimg tool to create a bootable image:

oscdimg -u2 -bc:\tmp\etfsboot.com c:\tmp\ISO c:\tmp\image.iso

This will result in a file C:\tmp\image.iso. You can burn this ISO to disc.

Testing

After you’ve created the image, you should test it. Boot up a machine with it. What will first appear is the regular Windows Setup phase. You won’t be able to install Windows with it, as install.wim is missing. However, you can still use all the other tools present. After selecting languages, click “Repair your computer”. The system will offer to repair an existing Windows installation if there is one present in the machine’s disk. Be sure to deselect the OS it’s offering by clicking in the blank space. Then press Next >. Now we have a window with System Recovery Options.

First we need to initialize networking. Do this by selecting Command Prompt and enter:

 wpeutil initializenetwork

Verify network operating with ipconfig:

ipconfig

Continue on by starting the msiscsi service:

net start msiscsi

Now start the iSCSI initiator applet:

iscsicpl

Configure your iSCSI backup target in the initiator. Select System Image Recovery in the System Recovery Options menu to start restoring a backup.

References

Microsoft: Deployment Image Servicing and Management Technical Reference