Internet explorer 使用Powershell更改受信任域的Internet Explorer安全设置

Internet explorer 使用Powershell更改受信任域的Internet Explorer安全设置,internet-explorer,powershell,trusted-sites,Internet Explorer,Powershell,Trusted Sites,我想知道是否有可能在使用PowerShell的Internet Explorer中对受信任域进行以下更改 我要更改的Internet Explorer设置: 添加为受信任的站点 允许ActiveX筛选=启用 允许以前未使用的ActiveX控件在没有提示的情况下运行=启用 允许Scriptlets=启用 ActiveX控件的自动提示=禁用 二进制和脚本行为=启用 在不使用外部媒体播放器的网页上显示视频和动画=启用 下载已签名的ActiveX控件=启用 下载未签名的ActiveX控件=启用 初始化

我想知道是否有可能在使用PowerShell的Internet Explorer中对受信任域进行以下更改

我要更改的Internet Explorer设置:

  • 添加为受信任的站点
  • 允许ActiveX筛选=启用
  • 允许以前未使用的ActiveX控件在没有提示的情况下运行=启用
  • 允许Scriptlets=启用
  • ActiveX控件的自动提示=禁用
  • 二进制和脚本行为=启用
  • 在不使用外部媒体播放器的网页上显示视频和动画=启用
  • 下载已签名的ActiveX控件=启用
  • 下载未签名的ActiveX控件=启用
  • 初始化和编写未标记为脚本安全的ActiveX控件=启用
  • 仅允许已批准的域在不提示=禁用的情况下使用ActiveX
  • 运行ActiveX控件和插件=启用
  • 为标记为安全的ActiveX控件编写脚本=启用
    • 原来是这样的

      以下是我所做的:(以管理员身份运行powershell)

      现在,您已将所有设置作为值指出。诀窍是找到每个设置的正确值。 在我的案例中,我发现以下值: (页面中间有一点)

      现在我们需要知道首选值是什么。 在我的例子中,我发现值0是启用的,1是禁用的,3是(如果支持)提示

      接下来就很简单了

      -ActiveX控件和插件:允许ActiveX筛选=启用(2702)

      -ActiveX控件和插件:允许以前未使用的ActiveX控件在不提示=启用的情况下运行(1208)

      -ActiveX控件和插件:允许Scriptlets=Enable(1208)

      -ActiveX控件和插件:ActiveX控件的自动提示=禁用(2201)

      -ActiveX控件和插件:二进制和脚本行为=启用(2000)

      -在不使用外部媒体播放器的网页上显示视频和动画=启用(120A)

      -ActiveX控件和插件:下载签名的ActiveX控件=启用(1001)

      -ActiveX控件和插件:下载未签名的ActiveX控件=启用(1004)

      -ActiveX控件和插件:初始化和编写未标记为脚本安全的ActiveX控件=启用(1201)

      -仅允许批准的域在没有提示=禁用(120B)的情况下使用ActiveX

      -ActiveX控件和插件:运行ActiveX控件和插件=启用(1200)

      -ActiveX控件和插件:为标记为脚本安全的ActiveX控件编写脚本=启用(1405)


      对于-ActiveX控件和插件:下载未签名的ActiveX控件=启用(1004)选项,操作类型为 0允许 1提示 3禁止

      #Setting IExplorer settings
      Write-Verbose "Now configuring IE"
      #Add http://website.com as a trusted Site/Domain
      #Navigate to the domains folder in the registry
      set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
      set-location ZoneMap\Domains
      
      #Create a new folder with the website name
      new-item website/ -Force
      set-location website/
      new-itemproperty . -Name * -Value 2 -Type DWORD -Force
      new-itemproperty . -Name http -Value 2 -Type DWORD -Force
      new-itemproperty . -Name https -Value 2 -Type DWORD -Force
      
      #Navigate to the trusted domains folder in the registry:
      
      #Go to registry folder for Trusted Domains
      #Zone 2 in this case resembles the trusted domains (Or zones if you'd prefer)
      Set-Location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\zones\2"
      
      new-itemproperty . -Name 2702 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1208 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1209 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 2201 -Value 3 -Type DWORD -Force
      
      new-itemproperty . -Name 2000 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 120A -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1001 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1004 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1201 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 120B -Value 3 -Type DWORD -Force
      
      new-itemproperty . -Name 1200 -Value 0 -Type DWORD -Force
      
      new-itemproperty . -Name 1405 -Value 0 -Type DWORD -Force
      
      
      cls #Clear the screen
      cd C:\Windows\System32 #Go back to default folder