osd

Optimize the 'build and capture' time and size (SCCM Build)

 

build

Inspired by Johan's post http://www.deploymentresearch.com/Research/tabid/62/EntryId/174/Building-reference-images-like-a-boss.aspx

I am probably one of the few that uses SCCM to capture base images. I use it because I create a thick image and it keeps the history of packages that it has installed meaning that newly imaged machines will know that they have already installed software x when they recieve it's required deployment.

Patch the install.wim

Patching the default Windows 7 install.wim so it doesn't need to install as many updates during OSD.

1. Download WSUS Offline Update from  http://download.wsusoffline.net/

2. Extract to C:wsusoffline and run UpdateGenerator.exe

3.  Choose Windows 7 x64 Global and click start.

WSUS Offline Update

4. Important: Delete KB2506143, KB2533552 and KB2819745 from C:wsusofflineclientw61-x64glb if they exist. They break the wim. If your company hasn't deployed IE11 also delete patches for it.

5. Extract a Win7 SP1 Enterprise ISO to 'C:OS Windows 7 SP1 x64'

6. Create the dir C:mount

7. Mount the wim -

dism /mount-wim /wimfile:"C:OS Windows 7 SP1 x64sourcesinstall.wim" /mountdir:C:mount /index:1

 

8. Patch the wim -

dism /image:C:mount /Add-Package /PackagePath:C:wsusofflineclientw61-x64glb

9. Commit/Close the wim -

dism /unmount-wim /mountdir:C:mount /commit

10. Copy the 'OS Windows 7 SP1 x64' folder to an unc share and import into SCCM under Operating System Installers.

 

Use Mikael Nystrom's Cleanup Script

1. Download via http://deploymentbunny.com/2014/06/05/nice-to-know-get-rid-of-all-junk-before-sysprep-and-capture-when-creating-a-reference-image-in-mdt/

2. Place in a UNC Share.

3. Copy ZTIUtility.vbs from MDT 2013 to the UNC Share.

4. Modify Action-CleanupBeforeSysprep.wsf second line to reference the ZTIUtility.vbs in the same folder

<script language="VBScript" src="ZTIUtility.vbs"/>

5. Create a package in SCCM.

6. Before the capture steps create a run command step surrounded by 2 reboots:

cscript.exe Action-CleanupBeforeSysprep.wsf using the package created and disable 64-bit file system redirection

TS Clean

The updated wim will have the patches required for this step.

Access the wim directly from the distribution point

For this to work you need to tick the checkbox on the OS Installer properties to copy to a share, then also the Access content directly in the task sequence Apply OS step.

 

OS

imageprop

 

Monitor KB2894518 for mutiple reboot updates

http://support.microsoft.com/kb/2894518

Create a separate deployment for these updates to a collection that excludes your capture VMs

 

Tweak your Virtual Machine

  • Don't use the Legacy Network adapter (Have had issues at capture stage)

Visit http://www.deploymentresearch.com/Research/tabid/62/EntryId/174/Building-reference-images-like-a-boss.aspx for VM tweaks

  • Use 2 vCPUs
  • Use a RAM Disk

Fix for customized Adobe CC Acrobat in base image not activated

logoacro

 

If you put Adobe Acrobat in the base image using the steps from http://helpx.adobe.com/creative-cloud/packager/deploying-acrobat.html

Install Customization Wizard XI msi + mst then Install CC package msi and mst you may find it not activated.

To fix this during the OS Deployment add a run command line step to reinstall the CC package mst and mst.

 

acrobat step

A normal install program step fails....

 

KB: PXE boots using the wrong wim file.

loadwim

If you happen to change the source name of a boot wim the pxe point may boot using the old file. To fix rename

<Drive Letter>RemoteInstallSMSImages<WIMPkgID>oldbootname.wim to oldbootname.wim.old

Next PXE boot it will then use the new boot.wim file.

 

Versioning and naming your base SOE .wim during OSD

If you replace the base wim (via build and capture) frequently it can be good to set versions and date the wim file that you import. It makes it easy to revert back if a change didn't go so well. Below are the steps in my build and capture to do versioning and work around a bug with naming your captured image.

1. At the top of my task sequence I set a task sequence variable SOEBaseVersion, each time I do a build and capture this is incremented.

Set SOEBaseVersion

2. After 'Setup Windows and Configuration Manager'  I have a 'Run Command Line' step with the following command so that we can utilize that value on deployed machines if ever needed:

cmd.exe /c reg add HKLMSoftwareSOE /v SOEBaseVersion /d "%SOEBaseVersion%"

Set SOE Reg

 

3. Next I run a vbscript to set the task sequence variable TSDate to the date in the format YYYYMMDD

Set env = CreateObject("Microsoft.SMS.TSEnvironment")
env("TSDate") = DatePart("yyyy",Date) & Right("0" & DatePart("m",Date), 2) & Right("0" & DatePart("d",Date), 2)

Screenshot 2014-10-22 16.21.49

 

4. In the 'Capture the Reference Machine' step I can then use the TSDate Variable to create a unique file name for the capture and also use the version field. There is a bug with the SCCM console as it doesn't use the Description field when importing, the next 2 steps resolve that.

Capture

 

5. Connect to OS Capture share.

Connect to share

6. Copy imagex to a package, then use it to run the following command line

imagex.exe /info R:\WIN81_x64_Base-%TSDate%.wim 1 "Windows 8.1 Enterprise" "WIN81 x64 - %TSDate%"

Set Image Description

 

7.  You can now import into SCCM with all the fields filled in correctly

Add Operating System Wizard

 

 

 

Adding custom programs to the Set Default Programs UI

Capture

Hi, today I wanted the CMTrace tool to be recognised in the Set Default Programs control panel applet. There is a bit of information on the net but it's confusing.

In the registry you can set the program, launch arguments, file types and icon. This can be used for any app by modifying the reg file.

 

Download reg file

 

Once added you may like to use DISM.exe to extract your chosen defaults and import during your task sequence.

Modular Task Sequence groups - Just an idea

bricks

Maik Koster has created a really good tool that monitors/ keeps backup of task sequence changes

http://myitforum.com/cs2/blogs/maikkoster/archive/2011/05/12/versioning-monitoring-sccm-task-sequences.aspx

expanding from this it may be possible to mark groups of your task sequences as modules. So say when a task sequence changes the script would then record the xml changes of that module group and replace in all task sequences where it is used. It would be perfect for the apply driver steps.

I haven't really worked it all out as I don't have many task sequences for it to be super useful and it would be a bit to hacky. I hope Microsoft can implement modules and version control in the next release of ConfigMgr.

 

 

Take advantage of OEM Settings to display OSD state!

I have 2 scenarios that allows techs to determine the computers state. When the task sequence fails or when a Lab computer hasn't been added to a lab group. It's easy to enable the oembackground and rename a jpg picture. Group policy reg can disable the background picture.

Logon

For the first scenario you enable 'Continue on Error' for the very first group and have a catcher group at the end of the task sequence that runs only if TSVariable '_SMSTSLastActionSucceeded' = False. MDT Task sequences are setup like this by default. It is best if the captured wim you are deploying already has the background file in it for scenarios where it fails due to not having any network access.

 

In the catcher group you will need 3 steps:

1. Copy jpg: Run command line with disable 64-bit file system redirection using a package with the jpg file (Not needed if jpg is in the captured wim):
cmd.exe /c xcopy Fail-Wallpaper.jpg C:\Windows\System32\oobe\info\Backgrounds /i /y

2. Rename jpg: Run command line with disable 64-bit file system redirection
cmd /c ren C:\Windows\System32\oobe\info\Backgrounds\Fail-WallpaperMU1.jpg backgroundDefault.jpg

3. Enable OEMWallpaper: Run command line with disable 64-bit file system redirection
cmd /c reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background /v OEMBackground /t REG_DWORD /d 1 /f /reg:64

Download image files

 

I can expand and provide scripts on how I determine whether the computer is part of a lab ou/group based on name and ad object. Let me know!

 

Edit: This entry is for Windows 7, In Windows 8.1 you should do similiar but use the lockscreen - See the post on Windows 8.1 setting lockscreen and wallpaper for more information

SCCM USB Boot disk creator

USB

I made a little program that sets up usb drives to be bootable into OSD winpe. I made it because we are getting devices without dvd drives that can't pxe boot and our techs don't have access to create bootable usb's from the console as they need the dp cert and password.

You generate a boot iso from the console, then copy the cd contents to the source folder where the program resides.

Program and my bad source code (if anyone wants to improve it) https://send.estate/s?e=8d189f24f1c9ada[1]

Pre-Reqs:
Dot Net 3.5
A bootable iso generated from the SCCM Console

Instructions:
Copy all files from the bootable iso to the source folder that resides with the exe.
Distribute as you wish.

BDEDrive size

BDEdrive

 

It helps to set a bit more space for this partition if you add more components to the boot wim, I chose to use 1GB. SCCM uses the drive with the most space that isn't encrypted to copy the boot wim down. We had issues in operating system deployment if the boot wim needed to be downloaded, the task sequence would fail as there wasn't enough space to store the boot wim.