Internet explorer 在“中打开internet explorer站点”;“内部网模式”;via powershell
我正在使用windows身份验证在不同用户下自动测试站点。 我很快发现internet explorer“Intranet”设置是针对每个用户的 有没有办法:Internet explorer 在“中打开internet explorer站点”;“内部网模式”;via powershell,internet-explorer,powershell,internet-explorer-10,windows-authentication,Internet Explorer,Powershell,Internet Explorer 10,Windows Authentication,我正在使用windows身份验证在不同用户下自动测试站点。 我很快发现internet explorer“Intranet”设置是针对每个用户的 有没有办法: 使用powershell在“intranet”模式下强制打开网站 更改所有用户的Internet Explorer设置(以便每次使用新用户打开Internet Explorer时,不会丢失设置) $username=“域\用户” $password=“password” $secstr=新对象-TypeName System.Securi
找到了一种方法,但仍对如何通过PowerShell实现感兴趣:
Open Group Policy Editor, go to:
User Configuration > Administrative Templates > Windows Components
> Internet Explorer > Internet Control Panel > Security Page
Open "Site to Zone Assignment list"
Set Enabled, Click "Show" and enter:
Value Name: your site (ex: portal.site.local)
Value: 1
您可以尝试设置powershell脚本,将IE在注册表中的默认主页更改为作为计划事件运行。这应该在Windows 7中完成工作:
set-ItemProperty -name 'Start Page' -path 'HKCU:\Software\Microsoft\Internet Explorer\Main' -Value www.yoursite.com
仅在Windows 7上使用IE 8进行测试:
>让所有用户从HKLM而不是HKCU读取安全设置:
PS>仅设置HKLM#(-disable)
>使“google.com”成为内部网站:
PS>设置区域-URL“google.com”-区域级别1#(-1从列表中删除)
/M
Function Set-HKLM-Only {
param(
[switch]$disable
)
if($disable) {
Remove-ItemProperty -Path "$regIEpolSettings" -Name "Security_HKLM_Only" -Force
} else {
New-ItemProperty -Path "$regIEpolSettings" -Name "Security_HKLM_Only" -Value 1 -PropertyType dword -Force
}
}
Function Set-Zone {
param(
[parameter(mandatory=$true)]
[string] $URL,
[ValidateRange(-1,4)]
[parameter(
mandatory=$true,
HelpMessage="-1 = Remove from zonelist , 0 = This Machine , 1 = Local Intranet , 2 = Trusted Sites , 3 = Internet , 4 = Restricted Sites"
)]
[int] $ZoneLevel
)
if($ZoneLevel -lt 0) {
Remove-Item -Path "$regIEpolSettings\ZoneMap\Domains\$URL" -Force
} else {
New-Item -Path "$regIEpolSettings\ZoneMap\Domains\$URL" -Force
New-ItemProperty -Path "$regIEpolSettings\ZoneMap\Domains\$URL" -Name '*' -Value $ZoneLevel -PropertyType dword -Force
}
}
New-Variable -Scope Script -Name regIEpolSettings -Value "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" -Force