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
Open Notepad.
Copy and paste the script above.
Save the file with a
.bat
extension (e.g.,ResetGPO.bat
).
Step 2: Deploy the Batch Script Using SCCM
1. Create an SCCM Package
Open SCCM Console and navigate to Software Library > Application Management > Packages.
Right-click Packages and select Create Package.
Enter a name (e.g.,
Reset GPO Script
) and provide a description.Choose This package contains source files and specify the folder containing the batch script.
Click Next.
2. Create a Program
Select Standard Program and click Next.
Enter a name (e.g.,
Delete Registry.pol and Update GPO
).In the Command Line field, enter:
cmd.exe /c ResetGPO.bat
Choose Run with administrative rights.
Set the execution mode to Hidden to prevent user interruptions.
Click Next, then Finish.
3. Deploy the Package
Navigate to Software Library > Application Management > Packages.
Select the package and click Deploy.
Choose the target collection (e.g., all clients, specific workstations).
Specify the distribution points.
Set deployment options:
Purpose: Required (for forced execution) or Available (for optional execution).
Schedule: Define execution time.
Click Next and complete the deployment.
4. Monitor Deployment
Navigate to Monitoring > Deployments.
Select the deployment and check the Compliance status.
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.