How to apply Local Group Policy settings silently using the ImportRegPol.exe and Apply_LGPO_Delta.exe utilities.

参考:http://supportishere.com/how-to-apply-local-group-policy-settings-silently-using-the-importregpol-exe-and-apply_lgpo_delta-exe-utilities/

In many Organizations, the AD support team is separated from the team in charge of Imaging.  The AD team naturally is protective with their setup and fight any GPO setting that would result in more responsibility to their staff.  So that leaves us in some occasions having to turn to Local Group Policy to apply the settings we want.  I’ve recently come across some great tools provided by Microsoft (very quietly) for Government usage.  These tools allow you to basically back up your LGPO settings to a txt file and apply them on demand with a script silently.

MS link: http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-05-16-48/LGPO_2D00_Utilities.zip
BackUp link: https://panaconsulting.egnyte.com/h-s/20120118/077e07ba18c74413

How to use:

  1. Apply desired settings on a Windows 7 test machine, using the gpedit.msc MMC snap-in.

  2. Run the “ImportRegPol.exe” with the /parseonly and /log to pull settings and save to a specified LOG file.
    User settings and machine settings need to be captured separately:

    Capture User Example
    ImportRegPol.exe /u  C:\Windows\System32\GroupPolicy\User\registry.pol /parseonly /log <PathToSettingsFile>.log

    Capture Machine Settings Example:
    ImportRegPol.exe /m  C:\Windows\System32\GroupPolicy\Machine\registry.pol /parseonly /log <PathToSettingsFile>.log
  3. Use the Apply_LGPO_Delta.exe utility to apply the settings silently.  On restart the settings will take effect.
    Apply_LGPO_Delta.exe <PathToSettingsFile>.log /log <PathToLogFile>.log
  4. This can easily be added to an SCCM or MDT Task Sequence and tied to logic to ensure the correct settings get pushed to the appropriate target systems/users.

Command Line help for LGPO Tools:

Apply_LGPO_Delta.exe inputfile0 [inputfile1 ...] [/log LogFile] [/error ErrorLogFile] [/boot]

inputfileN             One or more input files specifying the changes to make.  Input files must be security template files, or registry-based policy files using a custom file format described below.  Apply_LGPO_Delta automatically determines whether a file is a custom policy file or a security template.  Security templates can be created using the “Security Templates” MMC snap-in.

/log LogFile           Writes detailed results to a log file.  If this option is not specified, output is not logged nor displayed.

/error ErrorLogFile   Writes error information to a log file.  If this option is not specified, error information is displayed in a message box dialog.

/boot                  Reboots the computer when done.

ImportRegPol.exe –m|-u path\registry.pol [/parseOnly] [/log LogFile] [/error ErrorLogFile] [/boot]

-m path\registry.pol   [for Computer configuration] or

-u path\registry.pol   [for User configuration]

Path\registry.pol specifies the absolute or relative path to the input registry policy file (which does not need to be named “registry.pol”).

/parseOnly             Reads and validates the input file but does not make changes to local group policy.  In conjunction with the /log option, can be used to convert a registry policy file to an input file for Apply_LGPO_Delta.

/log LogFile           Writes detailed results to a log file.  If this option is not specified, output is not logged nor displayed.  The logged results for the registry policy settings can be used as input for Apply_LGPO_Delta.

/error ErrorLogFile   Writes error information to a log file.  If this option is not specified, error information is displayed in a message box dialog.

/boot                  Reboots the computer when done.

时间: 2024-11-09 01:01:27

How to apply Local Group Policy settings silently using the ImportRegPol.exe and Apply_LGPO_Delta.exe utilities.的相关文章

10 Common Problems Causing Group Policy To Not Apply

10 Common Problems Causing Group Policy To Not Apply Group Policy is a solid tool and is very stable. Microsoft has made constant improvements to it since Windows 2000. It allows for the configuration and deployment of pretty much anything in your Ac

How to Add Trust Sites into IE before IE10 through Group Policy

Due to IE10 published, I'll conclude the methods that how to add trust sites in to IE of the version before IE10. General, there are three methods to set trust sites to client machine by GPO from DC configured on windows 2003 or windows 2008. If the

Three Steps to Migrate Group Policy Between Active Directory Domains or Forests Using PowerShell

Three Steps Ahead Have you ever wished that you had three legs? Imagine how much faster you could run.  Today we are going to look at three steps to migrating GPOs between domains or forests with PowerShell.  Now that is fast! The Problem Have you ev

DFS security warning and use group policy to set up internet security zones

Opening a file from a DFS domain share shows a security warning while openning from the server share directly doesn't. To solve this problem, add "*.domain.local" to intranet zone in internet options. To add the domain to the intranet zone autom

Group Policy Object Editor

Group Policy Object Editor The Group Policy Object Editor is a tool that hosts MMC extension snap-ins that manage policy settings. All functionality is provided by extension snap-ins. Administrators manage policy settings using the Group Policy Objec

详解组策略环回处理(group policy loopback processing)

环回组策略又称:Group Policy Loopback processing.是一种调试后可以限制组策略被执行的方式. 组策略(group policy)分为两部分, 上半部分是计算机策略(Computer policy), 下半部分是用户策略(User Policy) 环回处理可以让管理员执行用户策略基于计算机的OU. 正常的情况,Group Policy会被执行依照以下顺序: 1. 执行computer的policy基于computer OU 2. 执行user的policy基于user

[Windows] 导出所有设置过的Group Policy

通过命令gpresult /h xxx.html可以导出所有设置过的Group Policy. GPRESULT /R GPRESULT /H GPReport.html GPRESULT /USER targetusername /V GPRESULT /S system /USER targetusername /SCOPE COMPUTER /Z GPRESULT /S system /U username /P password /SCOPE USER /V 原文地址:https://w

利用组策略API 编辑GPO(Group Policy Object)

用windows自带的GPO Editor编辑修改,然后利用注册表监控器regFromApp监视注册表的改动,就知道某个策略修改了注册表的哪个字段了. 下面是禁止U盘访问的例子: 1 #include <gpedit.h> 2 #include <windows.h> 3 #include <objbase.h> 4 #include <comdef.h> 5 #include <sstream> 6 #include <iostream&

This program is blocked by group policy. For more information, contact your system administrator.

删除Web.config中下面部分代码<system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompil