每一台WinSer都需要进行通用配置实在太繁琐。(* ̄︶ ̄)。
以下介绍 Powershell 关闭防火墙、关闭IE增强安全配置、开启远程桌面和开启远程单用户多会话,Sysprep 创建VHD。
代码如下(示例):
# Machine IE Enhanced Security Configuration Path
$MachineKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
# User IE Enhanced Security Configuration Path
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
# Turn Off IE Enhanced Security Configuration
Set-ItemProperty -Path $MachineKey -Name "IsInstalled" -Value 0
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
# Turn Off Local Computer Firewall
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled $false
# Enable Remote Desktop
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
# Disable Single-User Remote Desktop Session
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name fSingleSessionPerUser -Value 0 -Force
Loading
Quoting:
https://stackoverflow.com/questions/9368305/disable-ie-security-on-windows-server-via-powershell