AWS Windows 2012 R2关闭IE增强安全配置

时间:2017-06-20 04:44:49

标签: powershell amazon-web-services internet-explorer windows-server-2012-r2

我正在尝试使用AWS + Internet Explorer Enhanced Security Configuration

启动Windows 2012 R2实例时自动禁用userdata

我在网上发现了一些帮助我这样做的功能。当我检查Local Server下的Server Manager时,它说IE Enhanced Security Configuration已关闭。然而,当我启动IE时,它表示它已启用。我怎样才能正确禁用此功能?

以下是我传递给AWS的userdata的文件:

<powershell>
    function Disable-InternetExplorerESC {
    $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
    Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
    Stop-Process -Name Explorer
    Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green
    }
    function Enable-InternetExplorerESC {
        $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 1
        Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 1
        Stop-Process -Name Explorer
        Write-Host "IE Enhanced Security Configuration (ESC) has been enabled." -ForegroundColor Green
    }
    function Disable-UserAccessControl {
        Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000
        Write-Host "User Access Control (UAC) has been disabled." -ForegroundColor Green    
    }

    Disable-InternetExplorerESC
</powershell>

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,最后使用以下userdata脚本实现了这个目的:

0

诀窍是实际删除键然后导致IE实际上禁用ESC。