Windows Server 2003
--
Questions
--
Followers
Top Experts
Login Script to import .reg file (setting proxy settings)
Hi,
I'm having a small problem with a particular script that I have assigned using group policy under:
User Config\Windows Settings\Scripts\Logon
The script is a .vbs and the idea is to import some registry data into the users registry (HKCU). I login and it doesn't work, however if I then manually run the .vbs file once the user has logged in, it works fine!
------This is the VBS:------
' VBScript.
On Error Resume Next
Dim Shell
Set Shell = CreateObject("WScript.Shel l")
shell.Run "C:\windows\regedit.exe /s \\domain\Netapps\Scripts\P roxy\proxy settings.r eg"
------This is the .reg file:------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Inter net Settings]
"MigrateProxy"=dword:00000 001
"AutoConfigProxy"="wininet .dll"
"MimeExclusionListForCache "="multipa rt/mixed multipart/x-mixed-replace multipart/x-byteranges "
"EnableNegotiate"=dword:00 000001
"ProxyEnable"=dword:000000 00
"PrivDiscUiShown"=dword:00 000001
"ProxyServer"="webmarshal: 8080"
"AutoConfigURL"="http://wpad.huntingtower.vic.edu.au/proxy.pac"
Also I am aware that GPO supports setting IE settings - however there is a massive bug that microsoft havent fixed that means you cant use FolderRedirection and config IE using GPO's at the same time. Unfortunately Folder Redirection is a crucial part of our setup, so this is my attempt at finding another way to set the IE configuration to a proxy server.
Is this being run at the wrong time, or is there another way to do what i'm trying to do?
Cheers,
Paul.
I'm having a small problem with a particular script that I have assigned using group policy under:
User Config\Windows Settings\Scripts\Logon
The script is a .vbs and the idea is to import some registry data into the users registry (HKCU). I login and it doesn't work, however if I then manually run the .vbs file once the user has logged in, it works fine!
------This is the VBS:------
' VBScript.
On Error Resume Next
Dim Shell
Set Shell = CreateObject("WScript.Shel
shell.Run "C:\windows\regedit.exe /s \\domain\Netapps\Scripts\P
------This is the .reg file:------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar
"MigrateProxy"=dword:00000
"AutoConfigProxy"="wininet
"MimeExclusionListForCache
"EnableNegotiate"=dword:00
"ProxyEnable"=dword:000000
"PrivDiscUiShown"=dword:00
"ProxyServer"="webmarshal:
"AutoConfigURL"="http://wpad.huntingtower.vic.edu.au/proxy.pac"
Also I am aware that GPO supports setting IE settings - however there is a massive bug that microsoft havent fixed that means you cant use FolderRedirection and config IE using GPO's at the same time. Unfortunately Folder Redirection is a crucial part of our setup, so this is my attempt at finding another way to set the IE configuration to a proxy server.
Is this being run at the wrong time, or is there another way to do what i'm trying to do?
Cheers,
Paul.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I would suggest that you use the regedit commad in a batch file. I use it and it works fine. Some regedit command parameters can be found here for your reference.
http://www.robvanderwoude.com/index.html
In case you have blocked the "registry editing tools" Â on the client machines where you are trying this login script to run, you can use the following article to get it to work.
http://poctum.com/techtips/Windows%20XP/RegEdit%20-S%20When%20a%20GPO%20Prevents%20Running%20RegEdit.htm
Finally, you mentioned that you cannot use the Folder Redirection and IE Settings in the same group policy. But I am sure you can achieve the same results by having multiple Group Policies one with the folder redirection and another one with he IE Settings.
http://www.robvanderwoude.com/index.html
In case you have blocked the "registry editing tools" Â on the client machines where you are trying this login script to run, you can use the following article to get it to work.
http://poctum.com/techtips/Windows%20XP/RegEdit%20-S%20When%20a%20GPO%20Prevents%20Running%20RegEdit.htm
Finally, you mentioned that you cannot use the Folder Redirection and IE Settings in the same group policy. But I am sure you can achieve the same results by having multiple Group Policies one with the folder redirection and another one with he IE Settings.
Try it .reg file
Code:
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Inter net Settings]
"MigrateProxy"=dword:00000 001
"ProxyEnable"=dword:000000 01
"ProxyServer"="ProxyAddres s:PortNumb er"
"ProxyOverride"="Exception Addresses; <local>"
"EnableAutoProxyResultCach e"=dword:0 0000001
You can also use the following vbscript to verify that your changes are successful.
Code:
 strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &Â strComputer _
  & "\root\cimv2\Applications\ MicrosoftI E")
Set colIESettings = objWMIService.ExecQuery _
  ("Select * from MicrosoftIE_LANSettings")
For Each strIESetting in colIESettings
  Wscript.Echo "Autoconfiguration proxy: " & strIESetting.AutoConfigPro xy
  Wscript.Echo "Autoconfiguration URL: " & strIESetting.AutoConfigURL
  Wscript.Echo "Autoconfiguration Proxy detection mode: " & _
    strIESetting.AutoProxyDete ctMode
  Wscript.Echo "Proxy: " & strIESetting.Proxy
  Wscript.Echo "Proxy override: " & strIESetting.ProxyOverride
  Wscript.Echo "Proxy server: " & strIESetting.ProxyServer Â
Code:
[HKEY_CURRENT_USER\Softwar
"MigrateProxy"=dword:00000
"ProxyEnable"=dword:000000
"ProxyServer"="ProxyAddres
"ProxyOverride"="Exception
"EnableAutoProxyResultCach
You can also use the following vbscript to verify that your changes are successful.
Code:
 strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &Â strComputer _
  & "\root\cimv2\Applications\
Set colIESettings = objWMIService.ExecQuery _
  ("Select * from MicrosoftIE_LANSettings")
For Each strIESetting in colIESettings
  Wscript.Echo "Autoconfiguration proxy: " & strIESetting.AutoConfigPro
  Wscript.Echo "Autoconfiguration URL: " & strIESetting.AutoConfigURL
  Wscript.Echo "Autoconfiguration Proxy detection mode: " & _
    strIESetting.AutoProxyDete
  Wscript.Echo "Proxy: " & strIESetting.Proxy
  Wscript.Echo "Proxy override: " & strIESetting.ProxyOverride
  Wscript.Echo "Proxy server: " & strIESetting.ProxyServer Â
.reg file
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Inter net Settings]
"MigrateProxy"=dword:00000 001
"ProxyEnable"=dword:000000 01
"ProxyServer"="ProxyAddres s:PortNumb er"
"ProxyOverride"="Exception Addresses; <local>"
"EnableAutoProxyResultCach e"=dword:0 0000001
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwar
"MigrateProxy"=dword:00000
"ProxyEnable"=dword:000000
"ProxyServer"="ProxyAddres
"ProxyOverride"="Exception
"EnableAutoProxyResultCach






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Okay, i figured this one out!!
I was running the script from
'User Config\Windows Settings\Scripts\Logon'
but it needed to be in:
'User Config\Admin Templates\System\Logon\Run these programs at user logon'
Thanks for the comments anyway..
I was running the script from
'User Config\Windows Settings\Scripts\Logon'
but it needed to be in:
'User Config\Admin Templates\System\Logon\Run
Thanks for the comments anyway..
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Windows Server 2003
--
Questions
--
Followers
Top Experts
Windows Server 2003 was based on Windows XP and was released in four editions: Web, Standard, Enterprise and Datacenter. It also had derivative versions for clusters, storage and Microsoft’s Small Business Server. Important upgrades included integrating Internet Information Services (IIS), improvements to Active Directory (AD) and Group Policy (GP), and the migration to Automated System Recovery (ASR).