We help IT Professionals succeed at work.

Edit group policies through batch file

outlaw45
outlaw45 asked
on
I am at a school that does not use active directory.  I need to go to individual computers and run a batch file to enable/disable a proxy filter.  Some computers have up to six (6) users log on per day.  How can I do this for all users without having to log on each user and make the change?  How do I make the group policy edit in XP part of the batch file and what about Vista Home Premium?
Comment
Watch Question

work around

try using remote desktop
>> "a proxy filter"

Do you mean a proxy server?

If so - the registry information is at:
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Internet Settings]
Value Name: ProxyServer, ProxyEnable, ProxyOverride
Data Type: REG_SZ (String Value)
Value Data: Server:Port
(from http://www.pctools.com/guides/registry/detail/292/)
If so - you can use reg add /f to change the proxy settings - and create a batch file - and run it as a logon script.


.
I.e. as you cannot use group policy - you could run the script from the local policies...
So - do some of them need access through the proxy - and others don't?
You can put the batch file in the All Users Startup folder so it will run each time a user logs in.  

Windows XP location:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

Vista Home Premium doesn't have the All Users profile, but you can place the batch file in each individual user's folder located:
C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

If you want to get fancy, you can have the batch file check if the registy key exists:

http://www.petri.co.il/reg_command_in_windows_xp.htm

Author

Commented:
I'm sorry, yes I mean proxy server.  XP allows me to edit the registry through a batch file and change the current user.  I need to affect the whole machine without logging on to every user and setting the LAN settings and proxy settings by hand.  I have too many many machines and too many users.  Sitting at the computer, running a batch file and making the change for all users is what I need to do.
You can configure proxy settings for all users - using HKLM, rather than HKCU:
http://technet2.microsoft.com/WindowsVista/en/library/16f13690-3ad2-4d03-92fd-6ca93806cfaa1033.mspx?mfr=true

Author

Commented:
For some reason, HKLM does not work on Vista Home Premium
have you tried the registery ? thought about using remote desktop ? do you have the same settings for all users on the same machine ?

waiting for your reply

Author

Commented:
The solution was partly answered.  Not much response.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.