'Script: Configuração de Rede LAN - Servidor Proxy:
' ie.vbs
'Versão: 01
'Tipo: Automatico
'Criacao 2012.03.10
'Modificacao 22012.03.10
'Modificacao Luciano
'Descricao: Configura ip de conexoes para servidor proxy
' ie.vbs
'Versão: 01
'Tipo: Automatico
'Criacao 2012.03.10
'Modificacao 22012.03.10
'Modificacao Luciano
'Descricao: Configura ip de conexoes para servidor proxy
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer _
& "\root\cimv2\Applications\MicrosoftIE")
Set colIESettings = objWMIService.ExecQuery _
("Select * from MicrosoftIE_LANSettings")
Set objWMIService = GetObject("winmgmts:\\" & strComputer _
& "\root\cimv2\Applications\MicrosoftIE")
Set colIESettings = objWMIService.ExecQuery _
("Select * from MicrosoftIE_LANSettings")
Const HKCU=&H80000001 'HKEY_CURRENT_USER
Const HKLM=&H80000002 'HKEY_LOCAL_MACHINE
Const HKLM=&H80000002 'HKEY_LOCAL_MACHINE
Const REG_SZ=1
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7
Const HKCU_IE_PROXY = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set oReg=GetObject("winmgmts:!root/default:StdRegProv")
Set oReg=GetObject("winmgmts:!root/default:StdRegProv")
Main
Sub Main()
Sub Main()
' Ligar o PrtoxystrProxyServer = "192.168.0.2:3128"
'strProxyOveride = "*.domain.com;*.domain2.com;*domain3.com"
strProxyOveride = "192.168.0.*"
CreateValue HKCU,HKCU_IE_PROXY,"ProxyServer",strProxyServer,REG_SZ
CreateValue HKCU,HKCU_IE_PROXY,"ProxyEnable",1,REG_DWORD
CreateValue HKCU,HKCU_IE_PROXY,"ProxyOverride",strProxyOveride,REG_SZ
'strProxyOveride = "*.domain.com;*.domain2.com;*domain3.com"
strProxyOveride = "192.168.0.*"
CreateValue HKCU,HKCU_IE_PROXY,"ProxyServer",strProxyServer,REG_SZ
CreateValue HKCU,HKCU_IE_PROXY,"ProxyEnable",1,REG_DWORD
CreateValue HKCU,HKCU_IE_PROXY,"ProxyOverride",strProxyOveride,REG_SZ
End Sub
Function CreateValue(Key,SubKey,ValueName,Value,KeyType)
Select Case KeyType
REG_SZ
CreateValue = oReg.SetStringValue(Key,SubKey,ValueName,Value)
Case REG_EXPAND_SZ
CreateValue = oReg.SetExpandedStringValue(Key,SubKey,ValueName,Value)
Case REG_BINARY
CreateValue = oReg.SetBinaryValue(Key,SubKey,ValueName,Value)
Case REG_DWORD
CreateValue = oReg.SetDWORDValue(Key,SubKey,ValueName,Value)
Case REG_MULTI_SZ
CreateValue = oReg.SetMultiStringValue(Key,SubKey,ValueName,Value)
End Select
End Function
Select Case KeyType
REG_SZ
CreateValue = oReg.SetStringValue(Key,SubKey,ValueName,Value)
Case REG_EXPAND_SZ
CreateValue = oReg.SetExpandedStringValue(Key,SubKey,ValueName,Value)
Case REG_BINARY
CreateValue = oReg.SetBinaryValue(Key,SubKey,ValueName,Value)
Case REG_DWORD
CreateValue = oReg.SetDWORDValue(Key,SubKey,ValueName,Value)
Case REG_MULTI_SZ
CreateValue = oReg.SetMultiStringValue(Key,SubKey,ValueName,Value)
End Select
End Function
Function DeleteValue(Key, SubKey, ValueName)
DeleteValue = oReg.DeleteValue(Key,SubKey,ValueName)
End Function
DeleteValue = oReg.DeleteValue(Key,SubKey,ValueName)
End Function
Function GetValue(Key, SubKey, ValueName, KeyType)
Dim Ret
Select Case KeyType
Case REG_SZ
oReg.GetStringValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_EXPAND_SZ
oReg.GetExpandedStringValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_BINARY
oReg.GetBinaryValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_DWORD
oReg.GetDWORDValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_MULTI_SZ
oReg.GetMultiStringValue Key, SubKey, ValueName, Value
Ret = Value
End Select
GetValue = Ret
Case REG_SZ
oReg.GetStringValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_EXPAND_SZ
oReg.GetExpandedStringValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_BINARY
oReg.GetBinaryValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_DWORD
oReg.GetDWORDValue Key, SubKey, ValueName, Value
Ret = Value
Case REG_MULTI_SZ
oReg.GetMultiStringValue Key, SubKey, ValueName, Value
Ret = Value
End Select
GetValue = Ret
End Function
Pra que serve isso?
ResponderExcluirscript para junto com a GPO, configurar proxy em todas maquinas da rede automaticamente,sem a necessidade de passar em maquinas e maquinas ! Mesmo que "ferramentas + opção de internet + conexoes + configurações lan
Excluir