2

I am wondering if there is a way to change the group policy settings for accounts without using the GUI tools (GPMC or the GPO editor MMC snap in). In other words can I can change these settings via a registry change or by using a tool like PowerShell? The idea is to automate this so it can be applied to a number of servers quickly without having to fire up a GUI.

The key values I am interested in is:

  • Log on locally
  • Log on as a service
Robert MacLean
  • 2,186
  • 5
  • 28
  • 44
  • Can you state the question a little more clearly? Are you referring to the GPMC GUI? Are you attempting to modify one of more GPOs using PowerShell, or are you attempting to modify the settings controlled by the GPO/s without actually touching the GPO/s themselves? – ThatGraemeGuy Jun 06 '09 at 19:01
  • @Graeme I have rephrased it, let me know if that is much better? – Robert MacLean Jun 08 '09 at 08:06

3 Answers3

3

SECEDIT is your friend for what you're trying to do. Have a look at the help for the tool. Basically, you're going to want to build a template containing the settings you're looking for. Then, you'll apply that template to computers on which you'd like those settings changed.

  • Open an empty Microsoft Management Console. Add a "Security Templates" snap-in with File / Add/Remove Snap-in.

  • Open the "Security Templates" node and the next node underneath (normally "C:\WINDOWS\security\templates").

  • Right-click the "C:\WINDOWS\security\templates" node and choose "New Template". Name the new template and set the description as you desire.

  • Expand the new template. Set the various settings as you'd like.

The security policy you created is stored in the "C:\WINDOWS\security\templates" directory by default, named with whatever name you chose and a ".INF" extension. Copy this file to a machine where you want to apply the settings.

On the machine where the settings are to be applied, run the following command from the directory where your ".INF" security template file is located:

SECEDIT /configure /db secedit.sdb /cfg <path and filename of INF file>

This will apply the security template to the local security database. You can verify the "before and after" by examining the local security policy. (Be sure and close / re-open the local security policy management tool between applications of the INF file, because, AFAIK, these tools don't dynamically refresh themselves.)

Evan Anderson
  • 141,071
  • 19
  • 191
  • 328
1

You can find a list of all the registry keys used by Group Policy here:

http://go.microsoft.com/fwlink/?LinkID=54020

Be aware that some GPOs do not use registry keys.

Also, if you have servers that you need to set policies on - why not use GPOs??? Much easier to manage - you can change policies and push from one computer with one GUI.

0

You could try to figure out where in the registry those specific policy settings are stored, and then manipulate them in a script using reg.exe. Keep in mind, though, that Group Policy will override your settings at each refresh.

I am not aware of any command-line based GPO editing tools, if that is what you mean.

Jay Michaud
  • 3,947
  • 4
  • 21
  • 36
  • I tried to export the registry via regedit, then make the change, then do another export and use WinMerge to compare but with no luck – Robert MacLean Jun 08 '09 at 07:57