Yesterday an OS Deployment friend (you know who you are…) asked around for a way to install .NET Framework 4.5.1 as a part of the reference image creation and I told him I would post it today, so here it is. The reason I do this with VB script wrappers (not only me, most of the people I know and works with OSD does that) is logging and full control, but also the fact that I have a bunch of VBscripts that are very similar and the fact that MDT has a very nice module called ZTIUtility that connects external scripts built in functions make this a very easy choice.
Hey, you might need 4.5.2 instead? –> https://deploymentbunny.com/2014/06/27/back-to-basic-net-framework-4-5-2-deployment-in-mdt-using-a-vb-script-wrapper/
How to Use it
Step 1: Download it
Download it from here: http://1drv.ms/TqAqVD
Step 2: Import it as an Application
Using the Deployment Workbench, import the application with the following options:
- Application Type:
- Application with source files
- Application with source files
- Details:
- Application Name: Install – Microsoft .NET Framework 4.5.1
- Application Name: Install – Microsoft .NET Framework 4.5.1
- Source:
- Source Directory: The location where you unzipped the files
- Source Directory: The location where you unzipped the files
- Destination:
- Directory Name: Install – Microsoft .NET Framework 4.5.1
- Directory Name: Install – Microsoft .NET Framework 4.5.1
- Command Details:
- Command Line: cscript.exe Install-NetFramework451.wsf
If you prefer PowerShell to import the application, here is an example POSH Snippet:
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
New-PSDrive -Name "DS001" `
-PSProvider MDTProvider `
-Root "E:\MDTBuildLab"
import-MDTApplication `
-path "DS001:\Applications\Install" `
-enable "True" `
-Name "Install – Microsoft .NET Framework 4.5.1" `
-ShortName "Install – Microsoft .NET Framework 4.5.1" -Version "" `
-Publisher "" `
-Language "" `
-CommandLine "cscript.exe Install-NetFramework451.wsf" `
-WorkingDirectory ".\Applications\Install – Microsoft .NET Framework 4.5.1" `
-ApplicationSourcePath "C:\Users\Administrator\Desktop\Install – Microsoft .NET Framework 4.5.1" `
-DestinationFolder "Install – Microsoft .NET Framework 4.5.1" `
-Verbose
Step 3: Download .NET framework 4.5.1 exe file and save it in the Application\Source folder
Download from http://www.microsoft.com/en-us/download/details.aspx?id=40779
Step 4: Modify the Task Sequence
Open your task sequence and add the application like this:
Sample of a Windows 7 task sequence with .NET Framework 4.5.1
Sample of a Windows 8.1 task sequence with .NET Framework 4.5.1
Note: You might need to add a reboot before and one after, since .Net Framework might feel better, my sequence does not need it, but yours might depending on what you add before this.
Note: For Windows 8/8.1 (Server 2012/2012 R2) I always add .NET 2/3 as Roles BEFORE adding 4.5.1, just to make sure nothing is messed up.
Step 5: Create your Ref Image
/mike
Categories: MDT, OS Deployment, OSD, Reference Image
Hi Mikael,
.net framwork can also be installed as a role in the MDT Task-sequ
No, you can add .net 2 and 3 to a Windows 8 and 8.1 as well as server 2012 and r2 but not 4.5.1 or 4.5.2.
Hi Mikael,
.net framework can also be installed as an role in the task sequence? Why using this method?
Thx
You can add/remove built in versions of .net
but 4.5.1 and above is a download and cannot be installed using roles
Edit:
The installer from the website…is this also valid for windows 8.1 ?
Thx
Yes, it is