Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124


Intune remediation refers to the process of using Microsoft Intune to automatically detect and fix common issues on managed devices. This is achieved through remediation scripts, which consist of a detection script to identify problems and a remediation script to resolve them. These scripts help maintain device compliance and security by addressing issues proactively, often before users even notice them. By leveraging Intune remediation, IT administrators can reduce support calls and ensure a smoother, more secure IT environment.
Using Intune remediation offers several key benefits for managing and securing devices in an IT environment :
Overall, Intune remediation enhances device management by combining proactive problem-solving with automation and security.
Whether enrolling devices via Intune or Configuration Manager, Remediation scripting has the following requirements:
Remediations requires users of the devices to have one of the following licenses:
Script remediation is disabled by default, to activate the “Scripts and Remediations” feature, you need to enable Windows license verification in Intune. Here’s how to do it :
Step 1: Access settings


Here are the steps for creating a remediation script in Microsoft Intune :


Settings step
In this section I’m gonna use 2 scripts (1 for detection, 1 for remediation).
# Detection logic
$ipv6DisabledInterfaces = Get-NetAdapterBinding -ComponentID ms_tcpip6 | Where-Object { $_.Enabled -eq $false }
if ($ipv6DisabledInterfaces.Count -eq (Get-NetAdapterBinding -ComponentID ms_tcpip6).Count) {
# IPv6 is disabled on all interfaces
Write-Host "Compliant: IPv6 is disabled on all network interfaces."
exit 0 # Return compliant state
} else {
# IPv6 is still enabled on one or more interfaces
Write-Host "Non-compliant: IPv6 is enabled on one or more network interfaces."
exit 1 # Return non-compliant state
}
try {
Write-Host "Starting remediation: Disabling IPv6 on all network interfaces." -ForegroundColor Green
# Retrieve all network interfaces with IPv6 enabled
$interfaces = Get-NetAdapterBinding -ComponentID ms_tcpip6 | Select-Object -ExpandProperty Name
if ($interfaces.Count -eq 0) {
Write-Host "No interfaces with IPv6 found. No changes needed." -ForegroundColor Yellow
} else {
foreach ($interface in $interfaces) {
try {
# Disable IPv6 binding on each interface
Disable-NetAdapterBinding -Name $interface -ComponentID ms_tcpip6 -ErrorAction Stop
Write-Host "IPv6 has been disabled on interface: $interface" -ForegroundColor Green
} catch {
Write-Host "Error disabling IPv6 on interface: $interface. $_" -ForegroundColor Red
}
}
# Update registry to disable IPv6 components system-wide
try {
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\ `
-Name DisabledComponents -Type DWord -Value 255 -Force
Write-Host "Registry updated to disable IPv6 components. A system restart is required for changes to take effect." -ForegroundColor Cyan
} catch {
Write-Host "Error updating registry: $_" -ForegroundColor Red
}
}
Write-Host "Remediation completed successfully. A system restart is required to apply changes." -ForegroundColor Green
} catch {
Write-Host "An unexpected error occurred during remediation: $_" -ForegroundColor Red
}
– Run script using logged-on credentials (No)
– Enforce script signature check (No)
– Run script in 64-bit PowerShell (No)

Assignments step



Remediation packages are executed in two ways :
As you can see in the following screenshot, IPv6 is enabled.
So let’s start manually remediation.

To apply manually remediation from Intune admin center :

New window will be displayed.



Creating and deploying remediation script packages in Intune can significantly enhance your device management strategy. By following the steps outlined in this guide, you can address compliance issues proactively and maintain a secure IT environment. Remember, the key to successful remediation is thorough testing and validation of your scripts before deployment. With these best practices in mind, you’ll be well-equipped to leverage Intune’s full potential, ensuring your devices are always up-to-date and secure.
Thanks