Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not adding IP's to the Intranet Zones

Status
Not open for further replies.

wasserfa89

Technical User
Apr 15, 2012
24
CH
Hi all

On Internet Explorer 9 256 Bit we encouter the problem that we can't adding sites to the intranet zone even with the script below:

--------------------------------------------------------------------------------------------------------------------------------------------
' Adds an IP to the Security Sites

Option Explicit

Dim oShell
Set oShell = WScript.CreateObject("WScript.Shell")

' Dim sSite, sDValue, sZone, sKey, sZonesPath, aKeys, aKey
sZonesPath="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"
sSite=0
sDValue=1
sZone=2
' create key
aKeys = Array( _
Array(sZonesPath & "10.25.2.99\","","2"), _
Array(sZonesPath & "10.25.2.99\","","1") _
)
For Each aKey In aKeys
' create key for sSite
oShell.RegWrite aKey(sSite), aKey(sDvalue)

' add * dword under the site's key and set the sonze
sKey=aKey(sSite) & "*"
oShell.RegWrite sKey, aKey(sZone), "REG_DWORD"
MsgBox "Done"
Next
-----------------------------------------------------------------------------------------------------------------------------

it dosen't work

The IPs above won't be added to the Sites

and we are not able to add manually sites to the Intranet Zone

Any ideas? IE 9 Problem?
 
If you can't do it manually, I would suspect permissions. When you say "add manually", do you mean through Internet Options or directly in the registry.


"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
ok coud be yes if you want to add the Sites the Button "ADD" is grayed out

 
Permissions (or a GPO). Log in as an admin and run the script. If that doesn't work, you can try manually adding the domain to the zone in the registry.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
both tried... Server temporary removed from GPO and then Add manually and this won't be saved
 
[dazed]Problem solved.. IE was corrupted and Reset was the solutions thanks for your help
 
Good to hear. Here's come code I use to remotely (or locally) add domains to any zone

Code:
'registry hives
CONST HKEY_CURRENT_USER = &H80000001
CONST HKEY_LOCAL_MACHINE = &H80000002

'registry data types
CONST REG_SZ = 1
CONST REG_DWORD	= 4

'security zones
CONST ZONE_MY_COMPUTER = 0
CONST ZONE_LOCAL = 1
CONST ZONE_TRUSTED = 2
CONST ZONE_INTERNET = 3
CONST ZONE_RESTRICTED = 4

sub addDomainToZone (strComputer, hexHive, strDomain, strContext, intZone)
	if (len(strSID)) then strSID = strSID & "\"
	set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")	
	objReg.CreateKey hexHive, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\"
	objReg.CreateKey hexHive, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" & strDomain
	objReg.SetDWORDValue hexHive, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" & strDomain, strContext, intZone
end sub

'example
addDomainToZone strComputerName, HKEY_CURRENT_USER, "", "google.com", "", ZONE_TRUSTED

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top