Re: Setting environmental variable with Group Policy
- From: Jerold Schulman <Jerry@xxxxxxxxxx>
- Date: Tue, 05 Jul 2005 13:50:49 -0400
On Tue, 05 Jul 2005 12:11:17 -0400, Mark Warbeck <mwarbeck@xxxxxx> wrote:
>Hi,
>
>I've got a bunch of machines I need to set an environmental variable on.
>Is there a way to do this with Group Policy, or perhaps a script? I
>don't want to have to visit each machine.
>
>Thanks,
>Mark
You can use a custom ADM file to set the new Value Names into the
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment".
See tip 8532 » Using Administrative Template Files with Registry-Based Group Policy.
in the 'Tips & Tricks' at http://www.jsifaq.com
OR you can write a script. For instance, to add the MyVar envitronment variable to every computer in your domain, set it to
XYZ, run the following on any XP workstation or Windows Server 2003, or W2K if you installed the support tools from the CD-ROM,
while logged on as a Domain Admin:
@echo off
setlocal
for /f "Tokens=1" %%c in ('net view^|Findstr /L /C:"\\"') do (
@echo reg add "%%c\HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V MyVar /T REG_SZ /F /D "XYZ"
reg add "%%c\HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V MyVar /T REG_SZ /F /D "XYZ"
)
endlocal
This won't take effect until the computers are restarted.
.
- References:
- Setting environmental variable with Group Policy
- From: Mark Warbeck
- Setting environmental variable with Group Policy
- Prev by Date: RE: Group Policy defaults?
- Next by Date: Authenticated Users/Domain Users Question
- Previous by thread: Setting environmental variable with Group Policy
- Next by thread: GPO does not disable XP Firewall
- Index(es):
Relevant Pages
|