Tools for scripting changes to local group policy?
I have been looking for a way to script changing individual settings in the local group policy under Windows XP Pro. I found a tool called snapreg.exe in the Windows Media Player Enterprise Deployment Pack available at http://www.microsoft.com/windows/windowsmedia/enterprise/deploypack.aspx.
snapreg.exe correctly updates the registry.pol and gpt.ini files under %SystemRoot%\System32\GroupPolicy and the local group policy. It has however one shortcoming: it does not seem to be able to delete a setting from the local group policy files, only change its value once set.
Are there any other tools or perhaps a COM object available for scripting that can be used to add, change and delete entries in the local group policy?
By the way, here is the documentation for snapreg.exe:
snapreg.exe correctly updates the registry.pol and gpt.ini files under %SystemRoot%\System32\GroupPolicy and the local group policy. It has however one shortcoming: it does not seem to be able to delete a setting from the local group policy files, only change its value once set.
Are there any other tools or perhaps a COM object available for scripting that can be used to add, change and delete entries in the local group policy?
By the way, here is the documentation for snapreg.exe:
Documentation for snapreg
-------------------------
Snapreg.exe is a utility for changing local Group Policy settings and
adding registry keys.
Note: It does not simply change the policy settings in the registry
but also updates or creates the Group Policy files in
%SystemRoot%\System32\GroupPolicy.
Download
--------
Snapreg.exe is included in the Windows Media Player Enterprise
Deployment Kit which can be downloaded from:
http://www.microsoft.com/windows/windowsmedia/download/
Despite its lack of documentation it is extremely useful for changing
local Group Policy settings.
Usage:
------
snapreg.exe ( /GetInfo | /SetInfo)
/GetInfo: reads registry and policy information listed in
regkey.ini from local machine and writes values to
regkey.txt and policy.txt respectively.
If regkey.txt is missing from the current
directory no action will be taken by snapreg.
/SetInfo: reads policy.txt and regkey.txt from current
directory and applies the values to local group
policy and local registry respecitvely.
Note: command line options are case sensitive.
regkey.ini
==========
regkey.ini is used by the /SetInfo mode of snapreg to generate
regkey.txt and policy.txt.
The format of regkey.ini is:
-------- snip --------------------
[Keys]
HKCU,Software\Myprogram\Keypath,ValueName
HKLM,Software\Myprogram\Keypath,ValueName
[Policies]
HKLM,Software\Policies\Company\Program,PolicySetting
HKCU,Software\Policies\Company\Program,PolicySetting
-------- snip --------------------
regkey.txt
==========
regkey.txt lists registry values which snapreg should set when called
with /SetInfo.
The format of regkey.txt is:
-------- snip --------------------
HKCU,Software\Myprogram\Keypath,ValueName,0x00010001,0
HKLM,Software\Myprogram\Keypath,ValueName,,"string value"
-------- snip --------------------
The first value above is a REG_DWORD value, indicated by
the 0x00010001 tag. The value is given in decimal notation.
The second value is a REG_SZ value.
policy.txt
==========
Policy.txt uses the same format for describing entries as regkey.txt
but only applies to local Group Policy.
-------- snip --------------------
[Policies]
HKLM,Software\Policies\Company\Program,PolicySetting,0x00010001,0
HKCU,Software\Policies\Company\Program,PolicySetting,,"string value"
HKLM,Software\Microsoft\Windows\CurrentVersion\policies,PolicySetting,0x00010001,1
HKCU,Software\Microsoft\Windows\CurrentVersion\policies,PolicySetting,,"string value"
-------- snip --------------------
0 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.