相信大部分Windows管理员在拿到操作系统的部署应用的第一件事,应该都是关防火墙,关IE增强安全设置等
至于为什么要这样做,因为有太多的坑是出在这上面了
但一次次的点击容易遗漏,而且麻烦,特别整理了一个禁用的脚本,供大家参考
Function Disable-Firewall
{
Set-NetFirewallProfile -Enabled False -All
Write-Host "防火墙已关闭" -ForegroundColor Yellow
}
Function Disable-IEESC
{
$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 | Out-Null
Set-ItemProperty -Path $UserKey -Name “IsInstalled” -Value 0| Out-Null
Write-Host "IE增强的安全设置已禁用" -ForegroundColor Yellow
}
Function Disable-UAC
{
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 | Out-Null
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -Value 0 | Out-Null
Write-Host "账户访问控制(UAC)已禁用" -ForegroundColor Yellow
}
Disable-Firewall
Disable-IEESC
Disable-UAC
Start-Sleep -s 3
转载于:https://blog.51cto.com/2902744/2055059