• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

I need a vbscript to add a site to the trusted zone of internet explorer

It has to be added to the hklm so it works for every user.
0
itbabe
Asked:
itbabe
  • 2
4 Solutions
 
BogeholmCommented:
Read an answar to a similar Q here:
http://blogs.technet.com/b/heyscriptingguy/archive/2005/02/14/how-can-i-add-a-web-site-to-the-trusted-sites-zone.aspx

You need to test if you can get it to work by changing script to point to HKLM

HKLM - Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\yourdomain.com

Create a DWORD 'http'.
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
prepare a reg file (you can export it from existing environment) and use from command-line

reg import <your_reg_file>

I think it's the most simply solution.
0
 
Tony MassaCommented:
This script would add "download.microsoft.com" to the list of trusted sites.  You can replace with "*" to add all microsoft.com sites to trusted sites zone.
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objReg=GetObject("winmgmts:\\" & strComputer &
"\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet
Settings\" _
    & "ZoneMap\Domains\microsoft.com"

objReg.CreateKey HKEY_CURRENT_USER, strKeyPath

strValueName = "download"
dwValue = 2

objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

Open in new window

0
 
Tony MassaCommented:
Disregard the previous code snippet...EE and my paste function don't agree:
TrustedSites.txt
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now