Injecting .NET Framework 3.5 During a Windows 10 Task Sequence

Injecting .NET Framework 3.5 During a Windows 10 Task Sequence

The following is a step by step guide to adding the .NET framework 3.5 to a System Center Configuration Manager (ConfigMgr/SCCM) OSD task sequence that deploys Windows 10.

You’ll find a few guides on the web for doing this but what makes this one different is that it describes how to inject .NET Framework into the deployed image offline before Windows setup runs. I don’t know of any reason why this is better than installing after Windows setup but it seems more elegant to me. Also, these steps can easily be applied to injecting other things as well like other features or Windows update files (.msu).

1. Prepare the package source folder.

In your software repository, create a folder for the package. In my lab my repository is on the site server and I generally place all software in a folder structure following a pattern of <Vendor>/<Product>/<Version>. Thus, for my lab, this equates to F:\ConfigMgr\Content\Software\Microsoft\DotNetFramework\3.5-Win101607(x64).

Within this folder create a subfolder named sxs.

.NET Package Source Folder

.NET Package Source Folder

2. Create the batch file.

Within the package source folder create a batch file with the following command in it:

DISM.exe /Image:%1\ /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:"%~dp0sxs"

I called this batch file InstallDotNet3.5.bat.

%1 is a batch file parameter equating to the first parameter specified on the command-line when calling the batch file.

See Current Directory in ConfigMgr Programs for more info on %~dp0.

3. Copy the .NET Framework cab

From the media of the corresponding Windows 10 version, copy the file microsoft-windows-netfx3-ondemand-package.cab from the sources/sxs subfolder to the sxs subfolder created in step 1.

sxs subfolder of the .NET Package Source Folder

sxs subfolder of the .NET Package Source Folder

4. Create a package in ConfigMgr.

This post assumes that you know how to create package in ConfigMgr so no detail is provided on this.

Use the appropriate UNC for the source location that corresponds to the folder created in step 1. Also, no program is needed or used — they may even cause problems since they are 32-bit.

Also make sure to distribute the package to the appropriate DPs.

5. Add to Task Sequence.

Within the appropriate task sequence — I do this in my build and capture task sequences normally — add a Run Command Line task before the Setup Windows and Configuration Manager task.

Set the Command line to

InstallDotNet3.5-offline.bat %osdisk%

and set the Package to the one create in step 4.

%osdisk% is a task variable whose value is passed to the batch file using the %1 parameter discussed above. Step 6 sets this task sequence variable.

Inject .NET Framework Task

Inject .NET Framework Task

6. Modify Partition Disk tasks

Set Variable on Windows partitions within all Partition Disk tasks to osdisk.

Partition Disk 0 - BIOS

Partition Disk 0 – BIOS

 

Partition Disk 0 - UEFI

Partition Disk 0 – UEFI

And that’s it. Six super easy steps.

No Comments

Cancel