Files
qmi-cloud-tf-modules/win-common/scripts/disable-ie-sec.ps1
Manuel Romero 9f4db8b3ce fix
2022-10-06 16:56:54 +02:00

23 lines
1.1 KiB
PowerShell

# Disable Internet Explorer Enhanced Security
function Disable-InternetExplorerESC {
try {
if (Test-Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}") {
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
Rundll32 iesetup.dll, IEHardenLMSettings
Rundll32 iesetup.dll, IEHardenUser
Rundll32 iesetup.dll, IEHardenAdmin
Write-Host "--- IE Enhanced Security Configuration (ESC) has been disabled."
} else {
Write-Host "--- Could NOT disable InternetExplorerESC."
}
} catch {
Write-Host "--- Could NOT disable InternetExplorerESC."
}
}
Disable-InternetExplorerESC