Re: Setting environmental variable with Group Policy

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.


.



Relevant Pages

  • Re: How to restrict use of a pc to one domain user only.
    ... To limit logons to the students taking the ... We put the subset of machines in an OU in Active ... “Log on locally” entry in the Group Policy for the OU. ... > with the domain admin rights) ...
    (microsoft.public.windows.server.security)
  • Re: How to restrict use of a pc to one domain user only.
    ... To limit logons to the students taking the ... We put the subset of machines in an OU in Active ... “Log on locally” entry in the Group Policy for the OU. ... > with the domain admin rights) ...
    (microsoft.public.windowsxp.security_admin)
  • Re: domain administrator user to installed software on workstations?
    ... the machines with Group Policy. ... The best way of installing software is...with a domain admin account or ... local domain admin, or do i need to created a special domain user so i ...
    (microsoft.public.win2000.security)
  • Re: I need Ideas on securing a remote Win2k machine
    ... > * You can set security filtering on a group policy object. ... > * You can set a policy to run an application at logon (your kiosk app, ... Create a new Organizational Unit for the kiosk computers and move ... suggests that I need to get the domain admin to do a lot of this. ...
    (microsoft.public.win2000.security)
  • Re: Scanning for unsecure shared folders
    ... be of help in securing your machines and it can be used on remote machines. ... then your network will be more secure. ... and bypass any Group Policy user configuration and reconfigure the computer. ...
    (microsoft.public.win2000.security)