SCCM diet

Online notes for reference

Tag Archives: OSD

SCCM 2012 OSD integrated with HTA including offline backup – Part 7

I have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task sequence.

I have read here, here, here and here to learn about log capture and used in my task sequence.

I have read here for how to sequence steps in task sequence

In Part 1 I explained the code in HTA , various HTA options and created package for HTA.

In Part 2 I explained how to create a custom USMT Package

In Part 3 I explained different groups in the task sequence highlight what each group does.

In Part 4 I explained hard drive partition group

In Part 5   I explained the offline USMT and Reinstall OS Step

In Part 6 I explained New Computer Install , Post Install and Applications Install Group

Part 7 – Copy logs Group

This group is set to continue on error because if there any error in copying logs , It will appear as if entire task sequence has failed. However it is up to you if you think copy logs is critical then uncheck continue on error.

P-4TS01

 

Next Sub Group is OSD Failed.

This sub group only runs if the if there is an error in steps before Copy Logs group. The is done by setting a task sequence variable as a condition

If _SMSTSLastActionSucceeded is false then only this sub group “OSD Failed” runs . Else the subgroup is skipped

P-4TS02

 

If the task sequence variable condition is true then next step is

Connect to OSD Logs Folder . This is a shared folder on the server (in my case SCCM Server) and everyone has change permissions to this folder.

HOWEVER ..I was not able to connect to this folder if I used any other account other than Domain admin account.I don’t why yet.

P-4TS03

 

 

Next step is Delete Folder if exists

This step has a checked Continue on error . This is done because if the folder for machine does not exist this step will fail because there is nothing to delete.

P-4TS04

 

 

However if the folder with machine name exists

Command as shown in screen below runs and deletes the folder

P-4TS05

 

Next create Folder to copy logs

If this step is run under sub group OSD Successful the folder will be Z:\OSD_Success rest everything will be same.

P-4TS06

 

Next step is Copy Logs

If this step is run under sub group OSD Successful the folder will be Z:\OSD_Success rest everything will be same.

P-4TS07

 

Next Sub Group is OSD Successful

This sub group only runs if the if all the steps before Copy Logs group complete. The is done by setting a task sequence variable as a condition

If _SMSTSLastActionSucceeded is True then only this sub group “OSD Successful” runs . Else the subgroup is skipped

P-4TS08

All the steps under OSD Successful are same as under OSD Failed described above. Any differences in path is noted in steps above.

This concludes the Part 7 and entire task sequence 🙂

 

Advertisements

SCCM 2012 OSD integrated with HTA including offline backup – Part 6

I have read here for how to sequence steps in task sequence

If you are new to HTA with SCCM it could take you 1 or 2 days to just setup your environment so just in keep in mind that it is a lengthy drawn out process.

In Part 1 I explained the code in HTA , various HTA options and created package for HTA.

In Part 2 I explained how to create a custom USMT Package

In Part 3 I explained different groups in the task sequence highlight what each group does.

In Part 4 I explained hard drive partition group

In Part 5   I explained the offline USMT and Reinstall OS Step

Part 6  – New Computer Install , Post Install and Applications Install Group

New Computer Group – This Group only runs if the task sequence variable OSDOSConfig is set to new computer else this group is skipped. The task sequence variable is set when new computer is selected in HTA.

P-3TS01

 

 

Next step is Use toolkit package

We need to run this because the next step is validate which runs a scripts , Validate script is part of MDT Tool kit package and needs to downloaded to computer before running validate step.

P-3TS02

 

Next step is validate

This step runs script name ZTIvalidate.wsf . This script will check if the hardware meets the minimum requirements  of windows 7 . You can change these settings if needed.

P-3TS03

 

Next Step is Apply Operating System

This step will install the OS onto a new computer .

P-3TS04

 

 

Next Step is Post Install . This group will for both new and refresh computers

P-3TS05

 

Next step is Use tool kit package .

P-3TS06

 

 

Next step is Gather , This runs MDT script ZTIGather.wsf . This script reads the envirnoment and sets task sequence variable values and run the rules set in CustomSettings.ini files .

If you dont use any steps in customsettings.ini you can also select first option “Gather only local data (do not process  rules)

P-3TS07

 

Next Step is Apply windows settings

Specify the Org Name , Product Key , Licensing mode , local Administrator password and time zone.

P-3TS08

 

Next is Apply Network settings.

In this step you can join computer to domain . Provide the user account that has rights to join computer to domain

P-3TS09

 

 

Next Step is Configure

It updates the values from unattend.xml in native MDT task sequence.

P-3TS10

 

Next Step is Auto Apply Drivers

Since I am using virtual machine there are no drivers involved , However during imaging of a physical machines this step is critical and will need more discussion.

P-3TS11

 

Next Step is Setup Windows and ConfigMgr

This step install SCCM Cilent

P-3TS12

 

Next Step is install software updates

You can choose to install either mandatory or all software updates.

Some times software updates takes long time if there are lots of updates to apply . Choose what is best in production.

If imaging needs to finish in a certain time then you can disable this step

P-3TS13

 

 

Next Step is restore User Data

This step will only run if the task sequence variable OSDOSConfig is set to Reinstall . This selection is made on the HTA screen

 

 

P-3TS14

 

Next step is Restore User State

It this uses USMT package

Enable continue on error or else if a file is missed during task sequence whole task sequence will fail

P-3TS15

 

When selected Customize how use profiles are restored , Add the files as shown below including the wallpaper.xml to restore wallpaper and other two files for profile data.

P-3TS16

 

 

Next step in Install Application . This group will run for both new computer install and reinstall computer scenario.

This step will install applications select in HTA

When an application is selected for install , It sets a task sequence variable as explained in Part 1

 

P-3TS17

 

In the example below if the task sequence variable is set to true then the application MS XML SP1 will be installed else this install will be skipped . The task sequence variable is set when the application is selected from HTA screen.

for MS XML SP1 task sequence variable is OSDXMLnotepad , If checked in HTA its stored value is true.

Download HTA and open in notepad to review these variables.

P-3TS18

 

If this task sequence variable is set to true , Application MS XML SP1 will be installed

P-3TS19

 

This concludes part 6

SCCM 2012 OSD integrated with HTA including offline backup – Part 5

I have read here for how to sequence steps in task sequence

If you are new to HTA with SCCM it could take you 1 or 2 days to just setup your environment so just in keep in mind that it is a lengthy drawn out process.

In Part 1 I explained the code in HTA , various HTA options and created package for HTA.

In Part 2 I explained how to create a custom USMT Package

In Part 3 I explained different groups in the task sequence highlight what each group does.

In Part 4 I explained hard drive partition group

Part 5  – This part will cover offline USMT , Reinstall OS steps in task sequence.

After partition group in task sequence  next  group is Restart in WinPE

This step is needed task sequence to check if machine is in WinPE or not . If not than this step will boot the machine in WinPE using variable _SMSTSInWinPE

P-2TS01

If the variable _SMSTSInWinPE is false then this step will run.

We need to run this step in order to do two things

P-2TS02

First – To display HTA and Second to backup the computer if this is reinstall.

Offline backup has one advantage that no user is logged in and no  processes are running .So likely hood of USMT failing is less .

Next Step  Is Display HTA

P-2TS04

As shown above package HTA1 just contains one file “SCCMDiet.hta” . It is a run command line step of task sequence. Now at this point the task sequence will be in WinPE and HTA will display.

From here on task sequence will run or skip steps based on selections made in HTA

Backup User data

Backup user data step will run if the task sequence variable OSDOSConfig  is set to reinstall.

P-2TS05

 

If the above condition evaluates to be true then next step is to Set local state location.

P-2TS06

Next step defines how backup will be done. With USMT 5.0 it has become very simple to do hard link backup in WinPE

P-2TS07

If you select the options as displayed in the screen above you will be able to capture User data in WinPE. This step is using USMT v1 package created earlier. This USMT package has extra wallpaper.xml in it.

We need to specify wallpaper.xml file in order for USMT to migrate the wallpaper.

P-2TS08

Select files and then add name of all three files.

After backup is complete next step is to install operating system. This group will run if OSDOSConfig task sequence variable is set to reinstall. ( This variable gets set while making OS selection in HTA)

P-2TS09

Next step is Apply Operating system

P-2TS10

This step will install the operating system . Windows 7 in this case.

 

This concludes part 5

SCCM 2012 OSD integrated with HTA including offline backup – Part 4

I have read herehereherehere and here for HTA .I used HTA available here and modified and used in my task sequence.

I have read hereherehere and here to learn about log capture and used in my task sequence.

I have read here for how to sequence steps in task sequence

If you are new to HTA with SCCM it could take you 1 or 2 days to just setup your environment so just in keep in mind that it is a lengthy drawn out process.

In Part 1 I explained the code in HTA , various HTA options and created package for HTA.

In Part 2 I explained how to create a custom USMT Package

In Part 3 I explained different groups in the task sequence highlight what each group does.

Part 4  – New Computer Hard drive partition

In part 4 I am going to review steps in first section of the task sequence .

Task sequence explained in Part 3 is basically divided into 2 groups

1st group is Execute task Sequence

2nd group is Copy logs

Execute Task Sequence

As seen below , 1st group is set to continue on error. What this means is that if task sequence fails at any step before 2nd group it will not abort the task sequence instead it will go to 2nd group Copy logs.

P-TS01

 

Partition if necessary

P-TS02

This is group as-is from MDT standard client task sequence . This group evaluates few conditions before executing next step.

As you can see from screen capture above All the conditions need to be true for this step to run

_SMSTSInWinPE equals TRUE – This is first condition that is processed , If the task sequence is the WinPE or not , If not in WinPE this step will be skipped.

_SMSTSMedia Type not equals OEMMedia – If the task sequence variable _SMSTSMediaType = OEMMedia this step will be skipped and disk will not be formatted. Because if prestage media is present then disk is ready and does not need to formatted. When a prestage media ( wim file) is created it has task sequence variable _SMSTSMediaType set to OEMMedia.

Last condition has is being evaluated is a WMI query and it has 3 conditions

Logical Disktype = 3 means a local disk , Device ID is the drive letter

Here is the condition that will be eventually gets evaluated –

if logical disk type is not equal to 3 this step will be skipped

Device ID is X: this step will be skipped

if file system is NTFS this step will be skipped

 

Next step is Script exists and non-NTFS partitions

P-TS03

 

This step will run when following conditions are met

If ZTIConfirmDiskPart.vbs exists

If DiskIndex = 0 , Disk index is the index number of a the disk containing this partition.

If disk partition type is “Installable file system” , other examples of partition types are FAT , Extended partition , NTFS , unknown etc.

if disk partition type is NTFS

If all the above conditions are true then task sequence moves to next step

Confirmation to Partition Disk

P-TS04

 

This step will will run the script as shown in the screen above

Format and Partition Disk (UEFI) .

This step will only  run if the task sequence variable _SMSTSBootUEFI is true .

P-TS05

 

UEFI based computers  have different requirements than BIOS based computers . Windows 8 uses UEFI .

GPT (GUID Partition table) type disk can have partitions of size 2.2 TB

GPT (GUID Partition table)  also supports 128 partitions

P-TS06

Windows RE Tools – This partition should be separate from windows partition . No drive letter is assigned to this partition

This partition has two main functions

Support fail over of windows partitions

Support Booting from Bit locked partitions

EFI – EFI is the system partition of UEFI based computers. Computer boots from this partition . It is formatted with FAT32 . This partition is managed by Operating system and should not contain any other files.

MSR – Microsoft reserved partition – MSR partition is used for drive management. There is one MSR partition for each drive.

OSDisk – It is where operating system files reside along with data.

Format and partition

This step runs if task sequence variable _SMSTSBootUEFI is not true

P-TS07

 

This step is for computers with BIOS . It will install the OS in the drive. Formatted with NTFS

p-TS08

 

By default MDT standard client task sequence assigns it a task sequence variable to the drive named OSDTemporaryDrive. I removed the OSDTemporaryDrive and select next formatted partition from the list.

P-TS10

 

This concludes Part 4

 

 

 

OSD fails with error 80070490

I came across this issue after adding a new wim file to SCCM and then editing the task sequence to add the wim file. Well it was all fine until then.

After I starting OSD again I got  error , Looking at smst log shows following

Image

I checked the package was available on distribution points no errors reported on the package.

After some searching over internet I found out that image index might not be correctly selected on new wim file. When I looked the OS image package properties , there were certain details missing 

Image

After selecting image 2-2 , I could see it showing all the fields correctly . This is image that I should have applied in Task sequence instead of 1-1

Image

After finding this out , This change needs to incorporated in OSD Task sequence

Image

After making these changes , OSD worked fine.

 

 

 

 

 

OSD Fails with error 801901F4

I was this issue with OSD failing to download package . There were errors for a package missing , unable to download .

Task sequence will usually fail with error 80070002

Image

While checking smsts.log , I found this in logs , Error 801901f4

Image

Some research on this pointed to installing hotfix 2801987, But this only applied to SCCM 2012 SP1 and I was running SCCM 2012 SP1 R2.

I tried removing Network access account and re adding it again did not work

I checked management point was available and IIS was functional  to eliminate http 500 errors.

Only way I was able to resolve this error was by checking allow anonymous access to distribution point.

Image

This fixed the issue for me.

Though while researching this error I could not find real reason for this error neither was there a one solution for this error.

I am yet to find out what caused this error . But OSD seems to working again for now.

 

Capture Task sequence media SCCM 2012

WIM file for OSD deployment for Windows 7 or Windows 8 can be generated using capture media feature in SCCM 2012 . This is two part process.  First part is to create capture media. Second part is run capture media on a pre installed windows 7 or 8 machine.

Steps on SCCM Server

Image

Image

Provide the path for iso file.

Image

Provide boot image and distribution point where boot image is distributed.

Image

Image

Image

This will finish the capture media step.

Steps to be done in workstation

Insert the iso generated from steps above on either a windows 7 or windows 8 machine.

Setup will start (make sure workstation is not member or AD domain.

Image

Provide the path where wim file will be stored. Provide user name and password to connect to share.

Image

Provide information as needed

Image

Click finish. Once complete it will place wim file in the folder specified.

Image

This WIM can be used to create a OSD deploy task sequence for Windows 7 or Windows 8

Identifying missing drives for OSD preperation

To identify missing drivers for a hardware model . Install OS on the computer model and then go to device manager. If the workstation is missing any drivers those can easily identified with exclamation marks over the devices

Image

Select the device and go to properties and then go to details tab and from details tab select the hardware ID’s from drop down menu

Image

After this you need some help from internet to narrrow down which device it is , some site like pcidatabase.com is great resource for finding more about device codes.

Key in the vendor number and followed by device in second field and a matching device is likely to presented

Image

Some trial and error will get there.

Then visit vendor website and download the suitable driver.

Installing RightFax 10 client using SCCM

Part 1 – Getting right drivers on Windows 7 x64 machine.

Scenario

Windows 7 x64 , SCCM and Rightfax 10 and Printer drivers installed during OSD

To install Rightfax 10 on windows 7 x64 bit requires HP LaserJet 4 printer drivers. These drivers are no longer shipped with Windows 7 and therefore needs to be downloaded from Microsoft catalogue update website . Since HP website also redirects you to windows update website.

After downloading and unzipping the file there is folder starting with AMD64 . Microsoft update catalogue  website will have drivers for x86 , AMD64 and IA64 .

For windows 7 x64 only AMD64 drivers are needed.

When Rightfax installs it will install HP LaserJet 4250 PCL6 for RightFax Fax printer

Create a package in SCCM without program

Unzip the driver file and create a package in SCCM without any install program and distribute it to distribution points

Adding Drivers to OSD task sequence in SCCM

Once driver package is distributed edit the SCCM OSD task sequence to  install printer drivers by using run command line ,

Check disable 64 bit redirection , Since pnputil is 32 bit

Xxxxxx is the package ID of drivers

cmd.exe /c pnputil.exe -i -a %_SMSTSxxxxxx%\*.inf

Part 2 – Installing rightfax Client software using SCCM

Rightfax software DVD has a client install folder which contains all the files needed to install the client. There is a prereqs folder in client install folder which contains all the prereqs software needed for client install

Following are prereqs for Rightfax 10 client install

.Net 4.0

Visual Studio 2008 C++ Redistribution

Visual Studio 2010 C++ Redistribution

Visual Studio 2010 Tools for Office Runtime x64

Copy the Client folder to SCCM and create a package .  Add the following to a batch file and save in it the same source folder

dotNetFx40_Full_x86_x64.exe /q /norestart

VS2008_vcredist_x86.exe /qn

VS2010_vcredist_x86.exe /q /repair /norestart

vstor40_x64.exe /q

Rightfax print processor   (This step creates printer driver but the folder rightfax is not created)

msiexec.exe /i “rightfax print processor x64.msi” /qn RUNFROMSETUP=1 INSTALLDIR=”C:\Program Files (x86)\RightFax\”

Rightfax client install

msiexec.exe /i “rightfax product suite – client.msi” /qn REBOOT=ReallySuppress RUNBYRIGHTFAXSETUP=2 CONFIGUREFAXCTRL=1 CONFIGUREFAXUTIL=1 ADDLOCAL=”FaxUtil,FaxCtrl” NETID=2 INSTALLDIR=”C:\Program Files (x86)\RightFax” RFSERVERNAME=Yourfaxserver_name

Create a program with following settings

Image

Create an advertisement to install the software

copype and makewinpemedia commands

To have windows PE boot images in SCCM 2012 , ADK install is required.

After ADK is installed boot images are placed in

Program Files (86)\Windows kits\8.1\Assessment and deployment kit\Windows Preinstallation envirnoment \x86 and or amd64\en-us\winpe.wim

Copype command will copy copy winpe.wim and related files to the destination folder and also rename winpe.wim to boot.wim

Copype x86 c:\winpe_x86

This command will copy x86 winpe environment to c:\winpe_x86 folder

Copype amd64 c:\winpe_amd64

This command will copy amd64 environment to c:\winpe_amd64 folder

Makewinpemedia will create a bootable winpe iso file.

This will create a bootable iso from winpe media.

Makewinpemedia /iso c:\winpe_amd64 c:\winpe_x64\winpe_amd64.iso

Adding Printer Driver to OSD TS

To add printer driver during OSD , Do the following

Extract the printer driver , Create a package without a program and distribute it.

In the OSD task sequence add run command line as shown ( Where xxxxx is the package ID )

P-PrinterDriver