【发布时间】:2018-08-17 06:43:52
【问题描述】:
在从最新的 AMI 构建 Windows Server 2016 实例时,我正在尝试在 AWS 上的 Packer 中使用 PowerShell 禁用 Internet Explorer 增强安全配置。
我在 PS 中从一个打包程序供应商调用以下函数:
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 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
Stop-Process -Name Explorer -Force -ErrorAction Continue
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."
}
Disable-InternetExplorerESC
但是,Stop-Process -Name Explorer -Force 会引发以下错误:
Stop-Process : Cannot find a process with the name "Explorer". Verify the process name and call the cmdlet again.
远程进入服务器并打开服务器管理器并检查本地服务器设置显示 IE 增强安全配置为“关闭”,但打开 Internet Explorer 仍将设置显示为“打开”并阻止下载。进行更改后,我尝试重新启动机器,但设置仍处于模棱两可的状态。是否有其他方法可以关闭我可以尝试的 IE ESC 或在 Packer 中解决此问题的其他方法?
【问题讨论】:
标签: powershell amazon-web-services internet-explorer windows-server-2016 packer