Tuesday, September 8, 2009

Trust my own domain in Windows XP and IE 7

With the introduction of Internet Explorer 7 we found that some script in GPO's and programs
on shares failed to run. This because a File Security Warning was shown.

Because we don't want to restrict users from adding sites to the Trusted Zone it was not an
option to do this with the internet explorer option in the GPO. For this purpose this script
is created to perform just this task.


'==========================================================================
'
' NAME: Add the current AD Domain to local intranet zone for Windows XP and Internet Explorer 7
'
' AUTHOR: Bas Steelooper , Steelooper Consulting
' DATE : 8-12-2008
'
' COMMENT: With the introduction of Internet Explorer 7 we found that some script in GPO's and programs
' on shares failed to run. This because a File Security Warning was shown.
'
' Because we don't want to restrict users from adding sites to the Trusted Zone it was not an
' option to do this with the internet explorer option in the GPO. For this purpose this script
' is created to perform just this task.
'
'==========================================================================


On Error Resume Next

Const HKEY_CURRENT_USER = &H80000001
Const HKEY_USERS = &H80000003

strComputer = "."
Set objReg = GetObject("winmgmts:" & "{impersonationLevel=impersonate}\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = ".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\" & "ZoneMap\Domains\steelooper.com\*.blog"
objReg.CreateKey HKEY_USERS,strKeyPath
strValueName = "*"
dwValue = 1
objReg.SetDWORDValue HKEY_USERS,strKeyPath,strValueName,dwValue

strKeyPath = ".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\" & "ZoneMap\Domains\steelooper.com\blog"
objReg.CreateKey HKEY_USERS,strKeyPath
strValueName = "*"
dwValue = 1
objReg.SetDWORDValue HKEY_USERS,strKeyPath,strValueName,dwValue

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" & "ZoneMap\Domains\steelooper.com\*.blog"
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strValueName = "*"
dwValue = 1
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" & "ZoneMap\Domains\steelooper.com\blog"
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strValueName = "*"
dwValue = 1
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue



Use it freely if you want. But please post here if you do.

No comments:

Post a Comment