It happens to us all. You’ve got a nicely configured Intune setup, your applications are packaged and ready to go, but one of them has a pesky requirement for the .NET Framework 3.5. To make matters more challenging, Microsoft hasn’t yet provided a way to enable or turn on Framework 3.5 through a simple configuration policy. Windows 11 insists that you enable Framework 3.5 via the Windows Optional Features panel. Fortunately, there’s a way around this—with a little help from PowerShell and Intune’s Win32 app packaging capabilities.
What Is .NET Framework 3.5?
The .NET Framework 3.5 is a Microsoft software development platform that provides a runtime environment and a library of pre-coded solutions for developers. It is often used to build and run applications that require older versions of the .NET Framework. Some legacy or enterprise applications depend specifically on .NET Framework 3.5, making it an essential component for many IT environments.
Why Push .NET Framework 3.5 via Intune?
- Deploying .NET Framework 3.5 through Intune offers several advantages:
- Automation: Intune allows you to streamline deployment across your organization, reducing manual effort and saving time.
- Consistency: Ensure that the framework is installed uniformly across all required devices, minimizing compatibility issues.
- Remote Deployment: Intune’s cloud-based platform enables remote installation, perfect for hybrid or fully remote workforces.
- Scalability: Whether you need to deploy to ten devices or ten thousand, Intune scales effortlessly to meet your requirements.
The Solution: Intune and PowerShell to the Rescue
Thankfully, you can bypass the Windows Optional Features panel entirely by leveraging PowerShell and packaging the installation into a Win32 application for deployment through Intune. Here’s a high-level overview of how to get this done.
Overview of the Deployment Process
For the setup files and a step-by-step guide, visit the GitHub repository. Below is a summary of the process:
- Prepare the Required Files
– Download the install.ps1 and check.ps1 files from the GitHub repository.
– Save the files to a designated directory, e.g., C:\temp\framework35. - Create a Win32 App Package
– Use the Intune Win32 Content Prep Tool to package the install.ps1 script.
– Configure the tool with the following settings:
– Source folder: C:\temp\framework35
– Installer file: install.ps1
– Output folder: C:\temp\framework35 - Upload and Configure the Intune Application
– Navigate to the Intune portal and create a new Win32 app.
– Configure the app with the following key details:
– Name: Microsoft .NET 3.5 Framework Online
– Developer: Microsoft
– Install Command: powershell.exe -ExecutionPolicy Bypass -file install.ps1 -Mode Install
– Uninstall Command: powershell.exe -ExecutionPolicy Bypass -file install.ps1 -Mode Uninstall
– Detection Script: Upload the check.ps1 file to handle custom detection logic. - Deploy the Application
– Assign the app to your required devices or groups.
– Use dependency-based deployment to ensure that .NET Framework 3.5 is installed wherever it’s needed.
Benefits of This Approach
This method provides a fast, reliable, and scalable way to deploy .NET Framework 3.5 to your Windows 11 devices. By leveraging PowerShell scripts and Intune’s Win32 packaging capabilities, you can:
- Avoid manual configuration through the Windows Optional Features panel.
- Ensure compatibility for applications that require Framework 3.5.
- Simplify ongoing management and updates.
Wrapping Up
Deploying .NET Framework 3.5 might seem like a hassle at first glance, but with the right tools and processes, it’s a problem that can be solved efficiently. For the full deployment guide and scripts, head over to the GitHub repository. With this setup, you’ll have Framework 3.5 out there quickly and seamlessly—so you can focus on what really matters: delivering value to your organization through user adoption and engagement.
Code from Github
# Author: Warren Sherwen
# Last Edit: Warren Sherwen
# Verison: 1.0
Param(
[Parameter(Mandatory=$true)]
[ValidateSet("Install", "Uninstall")]
[String[]]
$Mode
)
# Defines the log file location.
$Logfile = "$env:systemdrive\Temp\Logs\dotnet35.log"
# LogWrite Function.
Function LogWrite{
Param ([string]$logstring)
Add-content $Logfile -value $logstring
write-output $logstring
}
function Get-TimeStamp {
return "[{0:dd/MM/yy} {0:HH:mm:ss}]" -f (Get-Date)
}
if (!(Test-Path "$env:systemdrive\Temp\Logs\"))
{
mkdir $env:systemdrive\Temp\Logs
LogWrite "$(Get-TimeStamp): Microsoft Dot Net 3.5 install has started."
LogWrite "$(Get-TimeStamp): Log directory created."
}
else
{
LogWrite "$(Get-TimeStamp): Microsoft Dot Net 3.5 install has started."
LogWrite "$(Get-TimeStamp): Log directory exists."
}
If ($Mode -eq "Install") {
LogWrite "$(Get-TimeStamp): Micorosoft Dot Net 3.5 is installing, detailed logs can be found at $env:systemdrive\Temp\Logs\net35.log."
Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -LogLevel debug -LogPath "$env:systemdrive\Temp\Logs\net35.log" -NoRestart
LogWrite "$(Get-TimeStamp): Micorosoft Dot Net 3.5 is installed, detailed logs can be found at $env:systemdrive\Temp\Logs\net35.log."
LogWrite "$(Get-TimeStamp): Script is ending a restart is required, goodbye."
exit 1641
}
If ($Mode -eq "Uninstall") {
LogWrite "$(Get-TimeStamp): Micorosoft Dot Net 3.5 is uninstalling, detailed logs can be found at $env:systemdrive\Temp\Logs\net35.log."
Disable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -LogLevel debug -LogPath "$env:systemdrive\Temp\Logs\net35.log" -NoRestart
LogWrite "$(Get-TimeStamp): Micorosoft Dot Net 3.5 is uninstalled, detailed logs can be found at $env:systemdrive\Temp\Logs\net35.log."
LogWrite "$(Get-TimeStamp): Script is ending a restart is required, goodbye."
exit 1641
}
Leave a Reply