Deleting Registry.pol and Forcing Group Policy Update Using a Batch File - Deploy through SCCM

 

Deleting Registry.pol and Forcing Group Policy Update Using a Batch File - Software update cycle scan failures 

In some troubleshooting scenarios ( specially software update cycle scanning errors)  , it is necessary to remove the Registry.pol file to reset Group Policy settings and force an immediate update. This guide outlines how to accomplish this using a batch script and deploy it via SCCM. 

Step 1: Create a Batch File

Script to Delete Registry.pol and Update Group Policy

@echo off
setlocal
:: Define paths
set "RegPolPath=C:\Windows\System32\GroupPolicy\Machine\Registry.pol"
:: Check if the file exists and delete it
if exist "%RegPolPath%" del /f /q "%RegPolPath%"
:: Force Group Policy update
gpupdate /force
:: Notify user
echo Group Policy has been updated successfully.
pause
  1. Open Notepad.

  2. Copy and paste the script above.

  3. Save the file with a .bat extension (e.g., ResetGPO.bat).

Step 2: Deploy the Batch Script Using SCCM

1. Create an SCCM Package

  1. Open SCCM Console and navigate to Software Library > Application Management > Packages.

  2. Right-click Packages and select Create Package.

  3. Enter a name (e.g., Reset GPO Script) and provide a description.

  4. Choose This package contains source files and specify the folder containing the batch script.

  5. Click Next.

2. Create a Program

  1. Select Standard Program and click Next.

  2. Enter a name (e.g., Delete Registry.pol and Update GPO).

  3. In the Command Line field, enter:

    cmd.exe /c ResetGPO.bat
  4. Choose Run with administrative rights.

  5. Set the execution mode to Hidden to prevent user interruptions.

  6. Click Next, then Finish.

3. Deploy the Package

  1. Navigate to Software Library > Application Management > Packages.

  2. Select the package and click Deploy.

  3. Choose the target collection (e.g., all clients, specific workstations).

  4. Specify the distribution points.

  5. Set deployment options:

    • Purpose: Required (for forced execution) or Available (for optional execution).

    • Schedule: Define execution time.

  6. Click Next and complete the deployment.

4. Monitor Deployment

  1. Navigate to Monitoring > Deployments.

  2. Select the deployment and check the Compliance status.

  3. Troubleshoot any failures using SCCM logs (execmgr.log on client machines).

By following these steps, you can effectively reset Group Policy settings and enforce an immediate update using SCCM.

Popular Posts

Windows 11 24H2 Upgrade using Intune Feature Updates Policy

Deploying a Script through Intune to a Linux PC

Removing Obsolete Computer Records from Active Directory Using PowerShell (Only Windows Client Versions)