Link to home
Create AccountLog in
Windows Server 2003

Windows Server 2003

--

Questions

--

Followers

Top Experts

Avatar of H4Inf
H4Inf🇦🇺

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.Shell")
shell.Run "C:\windows\regedit.exe /s \\domain\Netapps\Scripts\Proxy\proxysettings.reg"

------This is the .reg file:------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"AutoConfigProxy"="wininet.dll"
"MimeExclusionListForCache"="multipart/mixed multipart/x-mixed-replace multipart/x-byteranges "
"EnableNegotiate"=dword:00000001
"ProxyEnable"=dword:00000000
"PrivDiscUiShown"=dword:00000001
"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.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Jejin JosephJejin Joseph🇦🇪

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.

Try it .reg file

Code:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyServer"="ProxyAddress:PortNumber"
"ProxyOverride"="ExceptionAddresses;<local>"
"EnableAutoProxyResultCache"=dword:00000001


You can also use the following vbscript to verify that your changes are successful.

Code:
 strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer _
    & "\root\cimv2\Applications\MicrosoftIE")
Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_LANSettings")
For Each strIESetting in colIESettings
    Wscript.Echo "Autoconfiguration proxy: " & strIESetting.AutoConfigProxy
    Wscript.Echo "Autoconfiguration URL: " & strIESetting.AutoConfigURL
    Wscript.Echo "Autoconfiguration Proxy detection mode: " & _
        strIESetting.AutoProxyDetectMode
    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\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyServer"="ProxyAddress:PortNumber"
"ProxyOverride"="ExceptionAddresses;<local>"
"EnableAutoProxyResultCache"=dword:00000001

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of H4InfH4Inf🇦🇺

ASKER

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..

ASKER CERTIFIED SOLUTION
Avatar of DarthModDarthMod🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
Windows Server 2003

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).